Everytime a Job is triggered, a Run is created with a payload of data.
A Run is a record of the execution of a Job. It is created from run()
function of a Job.
run()
function is called with some useful parameters. More on that in a second.Runs can exceed the maximum timeout on serverless platforms. If a Run exceeds this limit, it will be re-run. When it is re-run, any completed Tasks return their original output and they aren’t re-run. Read more about Resumability.
The payload is the data that triggered the Job. It is the same data that was sent to the Trigger that triggered the Job.
{ url: "https://..." }
.The io
object gives you access to Integrations and other useful functions. View the full reference for io
.
A few things you can do with io
:
io.runTask
.The context
object gives you access to information about the current Run, Job, Environment, Organization and Event. View the full reference for context
.
The run has been created but has not started yet. This is the initial status of a run.
The run is waiting to be executed. Runs can be queued because of Run Execution Concurrency Limits
If a run depends on a hosted integration, it will be in this status until the integration is ready.
The run is currently executing. This means that the run function is running.
The run is waiting, either because of a call to io.wait()
or because a task failed and will be retried at some point in the future. Runs in this state don’t count towards concurrency limits.
The run failed. This can happen if the run function throws an error or if a task fails and the run is not configured to retry.
The run completed successfully. This means that the run function finished executing and all tasks completed successfully.
The run was cancelled. This can happen if the run is cancelled manually.
The run timed out. This can happen if the run exceeds the maximum run duration, or if we receive a serverless function execution timed out response when hitting your endpoint repeatedly with no new task creation.
The run failed because the payload was invalid.
The run failed because the auth data could not be resolved when using a custom Auth Resolver.
View all Runs for a Job, all the way down to individual Tasks.
The io
object gives you access to Integrations and other useful functions.
The context
object gives you access to the current Run’s context.