Skip to main content
POST
/
runs
Trigger a workflow
curl --request POST \
  --url https://api.example.com/runs \
  --header 'Content-Type: application/json' \
  --data '
{
  "worfklowId": "<string>",
  "inputs": {}
}
'
{
  "id": "run_abc123",
  "versionName": "1.0",
  "status": "RUNNING",
  "createdAt": "2025-01-15T10:30:00Z",
  "steps": 5,
  "stepsCompleted": 2,
  "output": null
}

Overview

Use the POST /runs endpoint to trigger a workflow run. This endpoint accepts inputs that match your workflow’s Start Node configuration and returns a run object with status and tracking information.

Request

worfklowId
string
required
The UUID of your workflow. Found in your workflow’s URL.
inputs
object
required
Input data for your workflow. Must exactly match the parameters defined in your Start Node.Important: The keys and types must match your Start Node configuration exactly, or the request will fail.

Example Request

const response = await fetch("https://dibby.ai/api/runs", {
  method: "POST",
  headers: {
    Authorization: "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    workflowId: "737de5f8-759c-4a5b-bf9a-4cd08ac7f2e0",
    inputs: {
      customerName: "Alice",
      invoicePdf: "data:application/pdf;base64,JVBERi0xLjcKJ...",
    },
  }),
});

const run = await response.json();
console.log(run);

Response

id
string
Unique identifier for this workflow run
versionName
string
Version of the workflow that was executed
status
string
Current status of the run. Possible values: PENDING, RUNNING, FINISHED, FAILED
createdAt
string
Timestamp when the run was created
steps
number
Total number of steps in the workflow
stepsCompleted
number
Number of steps completed so far
output
object
The workflow’s output data (only available when status is FINISHED)
{
  "id": "run_abc123",
  "versionName": "1.0",
  "status": "RUNNING",
  "createdAt": "2025-01-15T10:30:00Z",
  "steps": 5,
  "stepsCompleted": 2,
  "output": null
}

Input requirements

The inputs object must exactly match your Start Node configuration.

Example

If your Start Node expects:
  • customerName (string)
  • invoicePdf (document)
Then your inputs must include both fields with matching types:
{
  "customerName": "Alice",
  "invoicePdf": "data:application/pdf;base64,JVBERi0xLjcKJ..."
}
Any mismatch in keys or types will result in an error.

Sending documents

Files must be base64-encoded with the appropriate data URI prefix.

JavaScript helper

export const fileToBase64 = (file) =>
  new Promise((resolve, reject) => {
    const reader = new FileReader();
    reader.onload = () => resolve(reader.result);
    reader.onerror = reject;
    reader.readAsDataURL(file);
  });

// Usage
const file = document.querySelector('input[type="file"]').files[0];
const base64String = await fileToBase64(file);

// Use in API call
const response = await fetch("https://dibby.ai/api/runs", {
  method: "POST",
  headers: {
    Authorization: "Bearer YOUR_TOKEN",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    workflowId: "YOUR_APP_ID",
    inputs: {
      document: base64String,
    },
  }),
});

Next steps

Get run status

Learn how to check the status and retrieve results of a workflow run