Skip to Content
trumpetdocs

Run workflow

Trigger an API-callable workflow with your brand API key.

POST /v1/workflows/{id}/run

Starts a run of an active workflow whose trigger is configured for external calls. trumpet accepts the request immediately and executes steps asynchronously. The response contains a dispatch id so you can correlate the run — it does not include per-step results.

Beyond the REST API

The Public API reference pages mostly cover resource operations — creating and updating Pods, listing statuses, and similar calls. Workflows are a separate automation layer: you design triggers, steps, branches, enrollment, and input mappings in the trumpet builder, then start runs from CRM events, in-app signals, or this endpoint. See Workflows.

API key

Use a brand API key in the Authorization: Bearer header. See Authentication for format and key management.

Before you call this endpoint

The workflow must be active and set up in trumpet to accept external runs. Publish it in the builder first, then pass a data object that matches what that workflow expects.

Path parameters

ParameterTypeRequiredDescription
idstringRequiredThe workflow ID (MongoDB ObjectId), e.g. from the workflow URL in the trumpet dashboard.

Body parameters

ParameterTypeRequiredDescription
dataobjectRequiredPayload passed into the workflow. Keys must match the fields your workflow is configured to accept. Values are validated before a dispatch is created.

Example request

curl -X POST https://trumpet.app/api/v1/workflows/69f0bafc4cc54b506b0355d8/run \
  -H "Authorization: Bearer trpt_a1b2c3_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "data": {
      "dealId": "12345",
      "ownerEmail": "alice@yourcompany.com"
    }
  }'

Replace dealId and ownerEmail with fields your workflow declares on its trigger. Omitted required fields are rejected before a run starts.

The request body does not choose which trumpet user runs the workflow. Enrollment on the workflow does. See Enrollment for audience types, owner-matching on integration triggers, and service-account patterns.

Success response

Returns 202 Accepted when the dispatch is queued:

{
  "success": true,
  "data": {
    "dispatchId": "69f0bafc4cc54b506b0355e2",
    "workflowId": "69f0bafc4cc54b506b0355d8",
    "status": "pending",
    "enrolledUserCount": 1,
    "createdAt": "2026-11-24T10:15:30.000Z"
  }
}

The run continues in the background. Configure notifications and run history in trumpet if you need to track outcomes beyond this response.

Error responses

StatusErrorCause
400Invalid workflow ID formatThe id path segment is not a valid ObjectId.
400Validation errorRequest body failed schema validation (for example missing data or wrong shape).
400Workflow is not fully configuredThe workflow is missing a trigger or has configuration errors.
400Workflow contains steps that cannot be run via API yetOne or more steps are not supported for API dispatch.
400Workflow contains steps that are not available for this workspaceA step is disabled or unavailable for your brand.
400Invalid trigger datadata does not match the trigger's declared inputs (message describes the field).
401Invalid or revoked API keyMissing, malformed, revoked, or deleted key.
404Workflow not foundNo active workflow with that id exists for your brand, or it cannot be started through this endpoint.
422Workflow enrollment is not configuredEnrollment is required before a run can start.
429Rate limit exceededMore than 30 requests per minute for this key. Retry after a short delay.

Runs are asynchronous

A 202 response only means the dispatch was accepted. Step failures after that do not change the HTTP status of this request. Use workflow history in trumpet, configured completion webhooks, or downstream logging to observe outcomes.

On this page