Run a Workflow
Run a specific workflow in background
The Workflows API allows you to trigger a workflow to run in the background. This endpoint is useful for running workflows on a schedule or when an event occurs. Once the Workflow Run is created, it will run asynchronously and you will receive a response immediately.
During the workflow run
The workflow run is generated in the background. You can check the status of the workflow run by polling the Get a Workflow Run endpoint.
Headers
string required Your unique API key for authentication.
This key is required in the header of all API requests, to authenticate your account and access Draft & Goal’s services. Get your API key from the Draft & Goal Studio.
Path Parameters
workflow_id string required The ID of the workflow you want to run.
Body
object required An object containing the input parameters for the workflow. Each key in this object represents an input node ID from your workflow.
You can obtain the input node IDs from the Workflow Builder input settings in the Draft & Goal Studio.
Inputs is required. To run a workflow without inputs parameters, you can pass an empty object.
Input Parameters Structure
string required The actual value to pass to the input node
string required The type of the input value. Possible values: “text”
{
"inputs": {
"Text_0": {
"value": "Hello, world!",
"type": "text"
}
}
} {
"inputs": {
"Text_0": {
"value": "Hello, world!",
"type": "text"
},
"Text_1": {
"value": "Hello, world!",
"type": "text"
}
}
} Response
success boolean required Whether the workflow run was successful.
data object required The data returned by the workflow run start.
{
"success": true,
"data": {
"id": "0cf35172-859e-4b26-8ce9-6c2588a77b40",
"message": "Workflow is running in the background."
}
}{
"type": "error",
"error": {
"message": "You don't have access to this workflow"
}
}{
"type": "error",
"error": {
"message": "Invalid workflow id"
}
} curl -X POST "https://agents-api.prod.dng.ai/api/v1/workflows/$WORKFLOW_ID/run" \
--header "x-api-key: $YOUR_API_KEY" \
--header "content-Type: application/json" \
--data \
'{
"inputs": {
"Text_0": {
"value": "Hello world",
"type": "text"
}
}
}'