Tasks
Tasks are the basic unit of work in a Workflow.
Similarly to Workflows, when a Task is referenced, it could be referring to either a Task Definition or a Task Run.
Task Definition
A Task Definition outlines what the specific step of the given Workflow Definition is responsible for executing. This could be, for example, interacting with a smart contract (calling a specific method), calling an API endpoint, invoking an AWS Lambda function or sending a notification email. A Task Definition is named using kebab-case (e.g., my-task
).
The default Task of any Workflow Definition is sending a webhook to your application's configured webhook_url
using the send-webhook
Task Definition.
Task Run
A Task Run is a specific instance (execution) of a Task Definition and will be attached to a Workflow Run. A Task Run is assigned a unique prefixed ID, e.g., task_4eC39HqLyjWDarjtT1zdp7dc
.
Task Runs are passed the Workflow Run context, which they can modify before returning the context to the Workflow ready for the downstream Task (if one exists).
Task State
A Task Run can be in any of the following states:
none
The task is not yet ready to run (upstream tasks are still pending or failed).
pending
The task is pending execution.
queued
The task has been queued and is awaiting a Worker slot.
running
The task is running on a Worker.
success
The task completed successfully.
shutdown
The task received an external signal to shutdown during execution.
restarting
The task received an external signal to restart during execution.
failed
The task failed.
pending_retry
The task failed but has retry attempts remaining.
Last updated