MobiariDocs
Admin APIWorkflows

Run a workflow now

POST
/stores/{store_id}/workflows/{workflow_id}/fire

Starts a run of the published version with payload as its trigger payload; answers 202 with the run, which continues in the background. A workflow that was never published runs its draft as a test (dry_run).

Authorization

bearer_auth
AuthorizationBearer <token>

Authorization: Bearer <token>. Either a session access token from POST /auth/login (refresh it with POST /auth/refresh) or a store API token (mobi_st_…). A store API token works only for the store it was issued in, and can do at most what its issuing user can there, narrowed to the scopes it was issued with.

In: header

Path Parameters

store_id*string

Store id

Formatuuid
workflow_id*string

Workflow id

Formatuuid

Header Parameters

Idempotency-Key?string

A unique value (e.g. a UUID) per logical request. Retrying with the same key within 24 hours replays the first response instead of repeating the side effect; the replay carries Idempotent-Replayed: true. Reusing a key for a different request is a 422 idempotency_key_reused; retrying while the first is still running is a 409 idempotency_request_in_progress. JSON bodies up to 1 MB.

Lengthlength <= 255

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/stores/497f6eca-6276-4993-bfeb-53cbbbba6f08/workflows/497f6eca-6276-4993-bfeb-53cbbbba6f08/fire" \  -H "Content-Type: application/json" \  -d '{}'
{
  "attempt": 0,
  "cancelled_at": "2019-08-24T14:15:22Z",
  "context": {},
  "created_at": "2019-08-24T14:15:22Z",
  "current_node_id": "string",
  "customer_id": "160c0c4b-9966-4dc1-a916-8407eb10d74e",
  "dry_run": true,
  "error_message": "string",
  "finished_at": "2019-08-24T14:15:22Z",
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "next_run_at": "2019-08-24T14:15:22Z",
  "retry_of": "a7f35b23-6f09-4e1c-8113-f2b51e0883ca",
  "started_at": "2019-08-24T14:15:22Z",
  "status": "pending",
  "store_id": "7fe87115-950c-4ae8-bd7e-970406bc9ac0",
  "trigger_payload": {},
  "updated_at": "2019-08-24T14:15:22Z",
  "version": 0,
  "workflow_id": "03e70e31-d7a4-4401-a629-6a4b6096cdfe"
}
{
  "code": "not_found",
  "details": {},
  "error": "Order not found"
}
{
  "code": "not_found",
  "details": {},
  "error": "Order not found"
}
{
  "code": "not_found",
  "details": {},
  "error": "Order not found"
}
{
  "code": "not_found",
  "details": {},
  "error": "Order not found"
}
{
  "code": "not_found",
  "details": {},
  "error": "Order not found"
}
{
  "code": "not_found",
  "details": {},
  "error": "Order not found"
}