Workflow Control Plane
"LangChain runs the workflow. AxonFlow decides when it's allowed to move forward."
The Workflow Control Plane provides governance gates for external orchestrators like LangChain, LangGraph, and CrewAI. Instead of modifying your orchestrator's code, you simply add checkpoint calls to AxonFlow before each step executes.
Overview
External orchestrators (LangChain, LangGraph, CrewAI) are great at workflow execution, but enterprises need governance controls. The Workflow Control Plane solves this by providing:
- Step Gates - Policy checkpoints before each workflow step
- Decision Types - Allow, block, or require approval
- Policy Integration - Reuses AxonFlow's policy engine
- Audit Trail - Every step decision is recorded
How It Works
Key Point: Your orchestrator runs the workflow. AxonFlow provides governance gates at each step transition.
Quick Start
1. Start AxonFlow
docker compose up -d
2. Create a Workflow
curl -X POST http://localhost:8080/api/v1/workflows \
-H "Content-Type: application/json" \
-d '{
"workflow_name": "code-review-pipeline",
"source": "langgraph"
}'
Note:
total_stepsis optional. Omit it — the server automatically sets it to the actual step count when the workflow reaches a terminal state (completed, aborted, or failed). This supports dynamic workflows like LangGraph where the number of steps is not known upfront.
Response:
{
"workflow_id": "wf_abc123",
"workflow_name": "code-review-pipeline",
"status": "in_progress"
}
3. Check Step Gate
Before executing each step, check if it's allowed:
curl -X POST http://localhost:8080/api/v1/workflows/wf_abc123/steps/step-1/gate \
-H "Content-Type: application/json" \
-d '{
"step_name": "Generate Code",
"step_type": "llm_call",
"model": "gpt-4",
"provider": "openai"
}'
Response (allowed):
{
"decision": "allow",
"step_id": "step-1"
}
Response (blocked):
{
"decision": "block",
"step_id": "step-1",
"reason": "GPT-4 not allowed in production",
"policy_ids": ["policy_gpt4_block"]
}
4. Complete Workflow
curl -X POST http://localhost:8080/api/v1/workflows/wf_abc123/complete
Gate Decisions
| Decision | Description | Action |
|---|---|---|
allow | Step is allowed to proceed | Execute the step |
block | Step is blocked by policy | Skip or abort workflow |
require_approval | Human approval required | Wait for approval (Enterprise) |
Step Types
| Type | Description | Example |
|---|---|---|
llm_call | LLM API call | OpenAI, Anthropic, Bedrock |
tool_call | Tool/function execution | Code execution, file operations |
connector_call | MCP connector call | Database, API integrations |
human_task | Human-in-the-loop task | Manual review, approval |
Workflow Sources
| Source | Description |
|---|---|
langgraph | LangGraph workflow |
langchain | LangChain workflow |
crewai | CrewAI workflow |
external | Other external orchestrator |
API Reference
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/v1/workflows | Create workflow |
| GET | /api/v1/workflows/{id} | Get workflow status |
| POST | /api/v1/workflows/{id}/steps/{step_id}/gate | Check step gate |
| POST | /api/v1/workflows/{id}/steps/{step_id}/complete | Mark step completed (optional output + usage metrics) |
| POST | /api/v1/workflows/{id}/complete | Complete workflow |
| POST | /api/v1/workflows/{id}/abort | Abort workflow |
| POST | /api/v1/workflows/{id}/fail | Fail workflow |
| POST | /api/v1/workflows/{id}/resume | Resume workflow |
| GET | /api/v1/workflows | List workflows |
Step Completion Payload
POST /api/v1/workflows/{id}/steps/{step_id}/complete accepts an optional JSON body. You can send:
output-- structured step output objecttokens_in-- actual input tokens consumedtokens_out-- actual output tokens producedcost_usd-- actual cost for the step
If omitted, the endpoint still succeeds and marks the step complete. The response is 204 No Content.
Fail Workflow
failWorkflow() terminates a workflow as failed with an optional reason. Unlike abortWorkflow(), which indicates a manual cancellation (e.g., due to a policy block), failWorkflow() indicates an error condition -- the workflow encountered an unrecoverable problem during execution.
After a workflow is failed, its status becomes failed and it cannot be resumed.
POST /api/v1/workflows/{id}/fail
Request Body:
{
"reason": "optional failure reason"
}
Response:
{
"workflow_id": "wf_abc123",
"status": "failed",
"reason": "optional failure reason"
}
SDK Examples:
// Go
err := client.FailWorkflow(workflowID, "pipeline error: step 3 timed out")
# Python
await client.fail_workflow(workflow_id, reason="pipeline error: step 3 timed out")
// TypeScript
await client.failWorkflow(workflowId, "pipeline error: step 3 timed out");
// Java
client.failWorkflow(workflowId, "pipeline error: step 3 timed out");
Community vs Enterprise
| Feature | Community | Enterprise |
|---|---|---|
| Step gates (allow/block) | Yes | Yes |
| Policy evaluation | Yes | Yes |
| SDK support (4 languages) | Yes | Yes |
| LangGraph adapter | Yes | Yes |
require_approval action | Returns decision | Routes to Portal HITL |
| Org-level policies | No | Yes |
| Cross-workflow analytics | No | Yes |
Troubleshooting
Gate Returns "allow" When Expected to Block
- Check if the policy exists and is enabled
- Verify the policy scope is
workflow - Check if conditions match the step request
Workflow Stuck in "in_progress"
- Ensure you call
complete_workflow()orabort_workflow() - Check for unhandled exceptions in your code
- Use the context manager for automatic cleanup
Connection Refused
- Ensure AxonFlow Agent is running:
docker compose ps - Check the endpoint URL matches your configuration
- Verify network connectivity
Examples
See the complete examples in examples/workflow-control/:
http/workflow-control.sh- HTTP/curl examplego/main.go- Go SDK examplepython/main.py- Python SDK examplepython/langgraph_example.py- LangGraph adapter examplepython/langgraph_tools_example.py- Per-tool governance exampletypescript/index.ts- TypeScript SDK examplejava/WorkflowControl.java- Java SDK example
Related
- SDK Integration - SDK examples for all 4 languages + LangGraph adapter
- Policy Configuration - Workflow policy examples
- Per-Tool Governance - Granular tool-level policy control
- External Orchestrators - Temporal, Airflow, and custom integrations
- Tracing & Audit - trace_id correlation and audit logging
- Choosing a Mode - Compare Proxy Mode, Gateway Mode, and Workflow Control Plane
- Multi-Agent Planning - AxonFlow's native orchestration layer
