Skip to main content
Workflows are automated multi-step processes that run in response to business events (triggers) or manual invocations. Each workflow has a mutable draft graph and one or more immutable versions that are actually executed. Runs are created when a workflow is triggered and execute each node (action / logic / trigger) in sequence; run history is preserved indefinitely for auditing and replay. Base URL https://api.genuka.com · Auth Authorization: Bearer <token> + X-Company: <companyId> · Getting Started

Endpoints at a glance


Workflows

GET /2023-11/admin/workflows

List all workflows for the authenticated company. Supports filtering and search. Query parameters
Success response (200 OK):
Error responses
  • 401 — missing or invalid bearer token.
  • 403 — authenticated user has no access to this company.

POST /2023-11/admin/workflows

Create a new workflow with an optional draft graph. Request body
Success response (201 Created):
Error responses
  • 401 — unauthenticated.
  • 422 — validation failed (e.g. name missing).

GET /2023-11/admin/workflows/{workflow}

Retrieve a single workflow including its active version summary. Path parameters
Success response (200 OK):
Error responses
  • 401 — unauthenticated.
  • 404 — workflow not found or belongs to a different company.

PUT /2023-11/admin/workflows/{workflow}

Update a workflow’s name, description, or draft graph. All fields are optional (partial update). Path parameters Request body
Success response (200 OK):
Error responses
  • 401 — unauthenticated.
  • 404 — workflow not found.
  • 422 — validation failed.

DELETE /2023-11/admin/workflows/{workflow}

Soft-delete a workflow and all its associated data. Path parameters
Success response (204 No Content) Error responses
  • 401 — unauthenticated.
  • 404 — workflow not found.

PATCH /2023-11/admin/workflows/{workflow}/toggle

Toggle the is_active flag of a workflow. Inactive workflows will not fire on events. Path parameters Request body: None — no body required for this action endpoint.
Success response (200 OK):
Error responses
  • 401 — unauthenticated.
  • 404 — workflow not found.

Workflow Versions

GET /2023-11/admin/workflows/{workflow}/versions

List all published versions of a workflow in descending revision order. Path parameters Query parameters
Success response (200 OK):
Error responses
  • 401 — unauthenticated.
  • 404 — workflow not found.

POST /2023-11/admin/workflows/{workflow}/publish

Snapshot the current draft as a new immutable version. By default the new version is immediately activated (becomes the version used for future runs). Path parameters Request body
Success response (200 OK) — returns the parent workflow resource with the newly activated version:
Error responses
  • 401 — unauthenticated.
  • 404 — workflow not found.
  • 422graph missing.

GET /2023-11/admin/workflows/{workflow}/versions/{version}

Retrieve a single version including the full immutable graph. Path parameters
Success response (200 OK):
Error responses
  • 401 — unauthenticated.
  • 404 — workflow or version not found, or version does not belong to the workflow.

Workflow Runs

GET /2023-11/admin/workflows/runs

List all workflow runs for the authenticated company. Query parameters
Success response (200 OK):
Error responses
  • 401 — unauthenticated.

POST /2023-11/admin/workflows/runs

Manually trigger a workflow run. The workflow must be active and have an active version. Request body
Success response (201 Created):
Error responses
  • 401 — unauthenticated.
  • 404 — workflow not found.
  • 422 — workflow is inactive ("This workflow is not active."), or no active version exists ("No active workflow version to run."), or validation failed.

GET /2023-11/admin/workflows/runs/{run}

Retrieve full details of a single workflow run, including per-node execution records. Path parameters
Success response (200 OK):
Error responses
  • 401 — unauthenticated.
  • 404 — run not found or belongs to a different company.

POST /2023-11/admin/workflows/runs/{run}/cancel

Cancel a run that is in queued or running status. Also marks any queued/running nodes as canceled. Path parameters Request body: None — no body required for this action endpoint.
Success response (204 No Content) Error responses
  • 401 — unauthenticated.
  • 404 — run not found or belongs to a different company.
  • 422 — run is already finished ({ "message": "Cannot cancel" }).

POST /2023-11/admin/workflows/runs/{run}/replay

Create a new run that re-uses the context of a finished run. The workflow must still be active. The new run uses the workflow’s current active version. Path parameters Request body: None — no body required for this action endpoint.
Success response (201 Created):
Error responses
  • 401 — unauthenticated.
  • 404 — run not found or belongs to a different company.
  • 422 — run is not yet finished (status must be success, failed, or canceled); or the parent workflow is inactive; or no active version exists.

Node Types

GET /2023-11/admin/workflows/node-types

Return all registered node type definitions. Used by the workflow editor to populate the node palette. This endpoint does not require X-Company in practice but the standard auth headers are still expected.
Success response (200 OK):
Error responses
  • 401 — unauthenticated.

Utilities

GET /2023-11/admin/workflows/stats

Return aggregate statistics for workflows and runs belonging to the authenticated company.
Success response (200 OK):
Error responses
  • 401 — unauthenticated.

GET /2023-11/admin/workflows/samples

Fetch a sample record for a supported automation model. Used in the workflow editor to preview live data for context binding. If an id is supplied and not found, falls back to the most recent record of that model type. Query parameters
Success response (200 OK):
If model is not in the allowed list, returns an empty array []. Error responses
  • 401 — unauthenticated.

POST /2023-11/admin/workflows/http/test

Proxy an outbound HTTP request from the server, returning the response details. Used in the workflow editor to test HTTP action nodes before publishing. Request body
Success response (200 OK):
If the request itself fails to connect, a 400 is returned:
Error responses
  • 401 — unauthenticated.
  • 400 — network error or connection failure (see message field).
  • 422 — validation failed (e.g. invalid method value).

POST /2023-11/admin/workflows/nodes/simulate

Execute a single workflow node handler in isolation and return its output. Useful for testing node configuration before running the full workflow. Request body
Success response (200 OK):
Error responses
  • 401 — unauthenticated.
  • 422 — unknown handler: { "error": "Unknown handler: BadHandler.name" }, or no company found for user.
  • 400 — handler executed but raised an exception: { "success": false, "handler": "...", "error": "..." }.

POST /2023-11/admin/workflows/whatsapp/simulate

Fire simulated WhatsApp webhook events to test WhatsApp-triggered workflows without a real device. Dispatches whatsapp.message_received and a type-specific event (e.g. whatsapp.text_received) into the workflow trigger service. Request body
Success response (200 OK):
Error responses
  • 401 — unauthenticated.
  • 422 — invalid type value or no company found for user.