You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* docs: Update runs.mdx
From what I can tell, it is expected for run functions to return with some sort of payload. Providing an example here as a reference and guideline.
* Made it clear returning data is optional and added some more detail below
---------
Co-authored-by: Matt Aitken <[email protected]>
Copy file name to clipboardExpand all lines: docs/documentation/concepts/runs.mdx
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,12 +23,15 @@ client.defineJob({
23
23
// 1. Run function with params
24
24
run: async (payload, io, ctx) => {
25
25
// 2. Regular code and Tasks
26
+
// 3. Optionally return data from run execution
27
+
return { status: 'success' }
26
28
},
27
29
});
28
30
```
29
31
30
32
1. The `run()` function is called with some useful parameters. More on that in a second.
31
33
2. Inside the run function you can write regular code and use [Tasks](/documentation/concepts/tasks).
34
+
3. You can return data, which will then be retrievable with [getRun](/sdk/triggerclient/instancemethods/getrun) or the [React hooks](/documentation/guides/react-hooks).
0 commit comments