On this page

run-process-flow

Run a process flow against the knowledge base. For KB→process-flow, first run a compiler-style flow (one designed to classify ingested KB evidence into a process hierarchy) — its terminal agent's output (see get-execution's last_agent_output) is a process_flow_manifest JSON for create-process-flow's manifest argument. Returns execution_id for get-execution.

What it is called on each surface

The wire name is run-process-flow everywhere: it is what the Wexa MCP server advertises, the REST path is POST /v1/run-process-flow, and each SDK exposes it under its own language's naming convention.

SurfaceName
Wexa MCP serverrun-process-flow
REST APIPOST /v1/run-process-flow
TypeScript SDKfabric.runProcessFlow()
Python SDKfabric.run_process_flow()

Arguments

1 of the 9 arguments is required. Omitting a required one is refused before the tool runs, at the validation stage, so it costs nothing and changes nothing.

ArgumentTypeRequiredNotes
agentflow_idstringOptionalAlias for process_flow_id.
filesarrayOptionalOptional file ids for execution context.
flow_namestringOptionalOptional desired name for a child flow the compiler should emit (appended to goal for factory runs).
goalstringRequiredNatural-language goal for this run.
input_variablesobjectOptionalOptional input variables.
kb_tagsarrayOptionalExtends (does not replace) a knowledge-base agent's own tag filter for THIS run only — additive alongside create-process-flow's kb_tags / manifest.knowledge_base.tags / the agent's stored context. Applied only to an agent that already has has_knowledge_base set; it does not switch an agent into knowledge-base mode.
process_flow_idstringOptionalProcess flow id to run.
session_idstringOptionalOptional conversation id for multi-turn grouping.
start_from_agent_idstringOptionalOptional agent id to start from.

project_id, projectID, organization_id and executed_by are not arguments you pass: the platform binds all four from the credential you authenticated with, and both SDKs refuse them before the request leaves your process — see server-bound arguments.

What it returns

The three surfaces wrap this differently, and code written against one will not read another correctly — see return shape.

A real response, captured from a live call to run-process-flow:

agentflow came back populated and is shown as … here, because the real value runs to thousands of characters. Read it from your own call rather than from this page.

{
  "content": [
    {
      "type": "text",
      "text": "{\"lifecycle_id\":\"qlc_000185\",\"result\":{\"agent_type\":\"Task\",\"agent_version\":null,\"agentflow\":\"\\u2026\",\"agentflow_id\":\"6ab1945e7566f41b5c28e308\",\"agentflow_name\":\"docs-fixture-flow\",\"agents_output\":[],\"anomaly_detected\":null,\"application_user_id\":\"6a79a770b6c128ccc24bfca7\",\"conclusion\":null,\"created_at\":1790023297.303432,\"duration_ms\":null,\"end_time\":null,\"executed_by\":{\"_id\":\"6a79a770b6c128ccc24bfca7\",\"application_user_id\":\"6a79a770b6c128ccc24bfca7\",\"is_external_application\":true,\"metadata\":null,\"name\":\"6a79a770b6c128ccc24bfca7\",\"type\":\"api\"},\"execution_context\":{},\"execution_id\":\"d8b83fa9-afa7-4619-886f-55fafe5c9bc6\",\"files\":[],\"goal\":\"Reply OK.\",\"goal_template\":null,\"input_variables\":{},\"interop_ask\":null,\"interop_resume\":null,\"is_external_application\":true,\"kb_tags\":[],\"parent_execution_id\":null,\"previews\":{},\"projectID\":\"6aa9beb7ec8121a43b6c791b\",\"runtime_inputs\":{},\"schedule\":null,\"session_id\":null,\"simulation\":false,\"start_from_agent_id\":null,\"status\":\"running\",\"task_id\":\"6ab196817566f41b5c28e31d\",\"total_price\":null,\"total_tokens\":null,\"trigger_source\":\"api\"}}"
    }
  ],
  "isError": false
}

Keeping the lifecycle_id is what lets you ask later why a call was allowed, refused or held.

Calling it

The same call on all four surfaces. Pick a tab once and every code block in the documentation follows it.

The ids in this example are real, and resolve against the project the documentation is written against. Swap them for your own. A value in angle brackets is one only you can supply, and the platform refuses a literal <...>.

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "run-process-flow",
    "arguments": {
      "goal": "<goal>"
    }
  }
}

Errors

Both SDKs raise the same typed errors, chosen from the gateway's own error string first and its HTTP status second. run-process-flow checks the fabric:agent.run grant, and reaches the seven classes every tool reaches — listed under the common set. These are the ones specific to it:

ErrorStatusRaised when
NotFound404Neither the flow id nor flow_name matches a process flow in this project, or start_from_agent_id no agent inside it.
ApprovalRequired202A policy held this call for a person to approve. The error carries the approval id; see below.
ConfigurationError5xxrun-process-flow is not available to you. Retrying will not help.

Governance

Every call to run-process-flow runs through the same ten-stage lifecycle as every other Wexa tool: the credential is resolved to a scope, the fabric:agent.run grant is checked, quota is drawn down, the arguments are validated, policy rules are evaluated, the call is executed, the result is shaped and redacted, and an audit record is written. The lifecycle_id in the response is the handle to that record.

run-process-flow is marked consequential, which means it changes something rather than only reading. Two things follow. It is audited in full rather than lightly, and a policy rule may hold it for human approval — in which case the call returns 202 and an ApprovalRequired error carrying the approval id, and the SDKs can wait for the decision and resume rather than making you call again.

See also

The tool index, errors, and which identifier goes where.