Setyenv · Docs
  • English
  • Spanish
  • Chinese
  • Japanese
  • Arabic
  • German
  • French
  • Hindi
  • Indonesian
  • Italian
  • Dutch
  • Portuguese
  • Russian
  • Turkish

Workflows

CRUD for workflow definitions.

GET /wp-json/pfw-workflow/v1/workflows

Lists all workflows visible to the current user.

Query parameters:

ParamTypeDefaultDescription
statusstring(all)Filter: active, inactive, archived
tagstring(all)Filter by tag slug
qstring(none)Full-text search on title and description
per_pageint20Max 100
pageint1

Response (200):

{
  "status": "ok",
  "data": {
    "items": [
      { "id": 42, "slug": "thank-big-orders", "title": "Thank big orders", "status": "active", "trigger_type": "woocommerce.order_paid", "node_count": 5 }
    ],
    "total": 1,
    "page": 1,
    "per_page": 20
  }
}

GET /wp-json/pfw-workflow/v1/workflows/{id}

Returns one workflow with its full graph.

POST /wp-json/pfw-workflow/v1/workflows

Creates a new workflow. Body is the full workflow definition (the agent uses this to build workflows from a sentence).

PATCH /wp-json/pfw-workflow/v1/workflows/{id}

Updates one or more fields. Supports partial updates.

DELETE /wp-json/pfw-workflow/v1/workflows/{id}

Soft-deletes (moves to archived). Returns 200. To purge, repeat with ?force=true.

POST /wp-json/pfw-workflow/v1/workflows/{id}/activate

Toggles the workflow to active. Idempotent.

POST /wp-json/pfw-workflow/v1/workflows/{id}/run

Triggers the workflow with a custom payload. Equivalent to clicking Run now in the editor.

Body:

{ "payload": { "any": "json", "your": "trigger_expects" } }