Skip to main content
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

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

The ID of the workflow you want to run.

Body

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. The actual value to pass to the input node The type of the input value. Possible values: “text”
One input parameter
  {
    "inputs": {
      "Text_0": {
        "value": "Hello, world!",
        "type": "text"
      }
    }
  }
Multiple inputs parameters
  {
    "inputs": {
      "Text_0": {
        "value": "Hello, world!",
        "type": "text"
      },
      "Text_1": {
        "value": "Hello, world!",
        "type": "text"
      }
    }
  }

Response

Whether the workflow run was successful. The data returned by the workflow run start. The workflow run ID. The message returned by the workflow run start.
Response 200
{
  "success": true,
  "data": {
    "id": "0cf35172-859e-4b26-8ce9-6c2588a77b40",
    "message": "Workflow is running in the background."
  }
}
403
{
  "type": "error",
  "error": {
    "message": "You don't have access to this workflow"
  }
}
404
{
  "type": "error",
  "error": {
    "message": "Invalid workflow id"
  }
}
Request Example
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"
      }
    }
}'