POST
/
v1
/
workflows
/
{workflow_id}
/
run
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"
      }
    }
}'
{
  "success": true,
  "data": {
    "id": "0cf35172-859e-4b26-8ce9-6c2588a77b40",
    "message": "Workflow is running in the 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

x-api-key
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

inputs
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.

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."
  }
}
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"
      }
    }
}'