Execute an API Workflow with osop run
OSOP GuideRun an API SOP workflow end-to-end. Real HTTP requests with headers, body, auth. Cost controls. Security gates. Execution log generated.
Choose which API SOP to execute. Example: stripe-payment-flow.osop.yaml
AI scans the workflow for security risks: destructive commands, missing approval gates, broad permissions, hardcoded secrets. Returns a risk score 0-100.
Review the risk assessment. Approve or reject. CLI nodes require --allow-exec flag.
Execute the workflow. API nodes send HTTP requests with headers, body, query params. Agent nodes call LLMs. Results flow between nodes via WorkflowContext.
Execution record: per-node duration, cost, status, HTTP status codes, response previews, AI token usage, human decisions.
Generate a standalone HTML report from the execution log. Open in any browser.
osop_version: "1.0"
id: "osop-run-api-workflow"
name: "Execute an API Workflow with osop run"
description: "Run an API SOP workflow end-to-end. Real HTTP requests with headers, body, auth. Cost controls. Security gates. Execution log generated."
tags: [osop, the-loop, api, execute, meta]
nodes:
- id: "select_workflow"
type: "human"
name: "Select .osop Workflow"
description: "Choose which API SOP to execute. Example: stripe-payment-flow.osop.yaml"
- id: "preflight_check"
type: "agent"
subtype: "llm"
name: "Pre-flight Risk Assessment"
description: "AI scans the workflow for security risks: destructive commands, missing approval gates, broad permissions, hardcoded secrets. Returns a risk score 0-100."
- id: "human_approve"
type: "human"
subtype: "review"
name: "Approve Execution"
description: "Review the risk assessment. Approve or reject. CLI nodes require --allow-exec flag."
security:
approval_gate: true
risk_level: "medium"
- id: "execute"
type: "cli"
name: "osop run"
description: "Execute the workflow. API nodes send HTTP requests with headers, body, query params. Agent nodes call LLMs. Results flow between nodes via WorkflowContext."
runtime:
command: "osop run workflow.osop.yaml --allow-exec --max-cost 1.00 --log"
- id: "log_generated"
type: "system"
name: ".osoplog Generated"
description: "Execution record: per-node duration, cost, status, HTTP status codes, response previews, AI token usage, human decisions."
- id: "view_report"
type: "cli"
name: "osop report"
description: "Generate a standalone HTML report from the execution log. Open in any browser."
runtime:
command: "osop report workflow.osop.yaml execution.osoplog.yaml -o report.html"
edges:
- from: "select_workflow"
to: "preflight_check"
mode: "sequential"
- from: "preflight_check"
to: "human_approve"
mode: "conditional"
condition: "preflight_check.risk_score > 30"
- from: "preflight_check"
to: "execute"
mode: "conditional"
condition: "preflight_check.risk_score <= 30"
- from: "human_approve"
to: "execute"
mode: "sequential"
- from: "execute"
to: "log_generated"
mode: "sequential"
- from: "log_generated"
to: "view_report"
mode: "sequential"
- from: "execute"
to: "select_workflow"
mode: "fallback"
label: "Execution failed, retry"