Runs
Execute Tasks with specific inputs.
Runs represent a specific execution instance of a Task. When you want Vern to perform an action defined by a Task, you create a Run.
Purpose of Runs
- Task Execution: Trigger the actual performance of a defined Task.
- Input Provision: Provide the specific data (inputs) required by the Task for this particular execution.
- Tracking: Each Run represents a traceable instance of a workflow execution, allowing you to monitor its status and results.
Creating Runs
Runs can be created via the Vern SDK or REST API. Each run requires a Task ID and can optionally include specific inputs.
Using the SDK
Here are examples of using the Vern SDK in different programming languages:
Using the REST API
Request Components:
taskId
(required): The ID of the task to executeinputs
(optional): Object containing task-specific input dataprofileId
(optional): User-specified UID for a profile linked via magic linkurl
(optional): A URL to be processed by the task
Response Status Codes:
Common run status codes:
200
: Task run created successfully400
: Invalid request parameters401
: Invalid or missing API key429
: Rate limit exceeded500
: Internal server error
Run Lifecycle and Status
A run goes through the following states during its lifecycle:
queued
: Initial state when the run is createdrunning
: The task is actively being executedcomplete
: Task execution finished successfullyfailed
: Task execution encountered an error
The current state can be retrieved through the API or SDK using the run’s ID.
Retrieving Run Status
You can check the status of a run using the SDK or REST API:
Here are examples of retrieving run status using the SDK in different programming languages:
The response includes:
id
: Unique identifier for the runtask
: Name of the executed taskinputs
: The provided input datastatus
: Current run statuscreated_at
: When the run was createdstarted_at
: When execution begancompleted_at
: When execution finishedresponse
: Task execution results (when completed)
Next Steps
Now that you understand Runs, explore the Tasks documentation to learn how to define the actions that your runs will execute. You can also learn about Webhooks to receive notifications when runs complete.