Execute an API Workflow with osop run

OSOP Guide

Run an API SOP workflow end-to-end. Real HTTP requests with headers, body, auth. Cost controls. Security gates. Execution log generated.

6 nodes · 7 edgesosop self
osopthe-loopapiexecutemeta
Visual
Select .osop Workflowhuman

Choose which API SOP to execute. Example: stripe-payment-flow.osop.yaml

sequentialPre-flight Risk Assessment
Pre-flight Risk Assessmentagent

AI scans the workflow for security risks: destructive commands, missing approval gates, broad permissions, hardcoded secrets. Returns a risk score 0-100.

conditionalApprove Execution
conditionalosop run
Approve Executionhuman

Review the risk assessment. Approve or reject. CLI nodes require --allow-exec flag.

sequentialosop run
osop runcli

Execute the workflow. API nodes send HTTP requests with headers, body, query params. Agent nodes call LLMs. Results flow between nodes via WorkflowContext.

sequential.osoplog Generated
fallbackSelect .osop Workflow
.osoplog Generatedsystem

Execution record: per-node duration, cost, status, HTTP status codes, response previews, AI token usage, human decisions.

sequentialosop report
osop reportcli

Generate a standalone HTML report from the execution log. Open in any browser.

ex-osop-run-api-workflow.osop.yaml
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"