cao-workflow

Author and validate Python workflow scripts for multi-step agent orchestration with CAO.

1.2k|249|Updated Jul 29, 2025
One-click install
npx skills add https://github.com/awslabs/cli-agent-orchestrator --skill cao-workflow
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cao-workflow
Source: https://github.com/awslabs/cli-agent-orchestrator/tree/main/skills/cao-workflow
Command: npx skills add https://github.com/awslabs/cli-agent-orchestrator --skill cao-workflow

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Coordinating multi-step, parameterized, or fan-out jobs across AI coding agents is error-prone when done ad hoc. This Skill guides you through authoring deterministic, resumable Python workflow scripts for CLI Agent Orchestrator (CAO), with a mandatory validation gate and explicit user approval before any run.

Core Features & Use Cases

  • Workflow Authoring: Write Python scripts using the cao_workflow package (step, run_step, get_inputs, emit_output) that fan work out across agents with stable step IDs and declared recovery policies.
  • Mandatory Validation: Run cao workflow validate to catch banned imports, nondeterministic constructs, and missing recovery policies before execution.
  • Resume & Halt Handling: Resume interrupted runs with cao workflow resume, resolve halted steps via --decide, and avoid replay divergence through deterministic script design.
  • Use Case: Summarize every file in a directory concurrently — author a parameterized fan-out script with a ThreadPoolExecutor, validate it, get user approval, then run it with a pre-announced run-id.

Quick Start

Ask the AI to author a CAO workflow script that summarizes each file in a target directory, validate it with cao workflow validate, and wait for approval before running.

Frequently Asked Questions about cao-workflow

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write a CAO workflow script in Python?

Write a .py file to ~/.aws/cli-agent-orchestrator/workflows/ that imports from the cao_workflow package. Use step() or run_step() to invoke agents, declare an INPUTS dict for parameters, and call emit_output() for the run result. Then validate with cao workflow validate before running.

How do I run steps concurrently in a CAO workflow?

Use a ThreadPoolExecutor and give every concurrent run_step call an explicit, stable step_id derived from sorted inputs. The default sequential call-N counter is not deterministic under concurrent scheduling, so resume would replay the wrong results without stable IDs.

What is a recovery policy in CAO workflow steps?

A recovery policy declares what re-running a step would mean: idempotent, reconcile, or manual. It is an author claim, not a protection — declaring idempotent on a step with side effects means resume will re-execute it. Omitting a policy via run_step halts for a human decision instead.

Why does CAO workflow validation fail on random or datetime imports?

Resume re-executes the script top-to-bottom and replays journaled step results. Nondeterministic top-level values from random, time, datetime, or uuid differ on replay and raise ReplayDivergenceError, so the validator flags them. Derive IDs from inputs instead.

How do I resume a halted CAO workflow run?

Run cao workflow resume <run-id>. A halted step surfaces as a ShimHTTPError with status 409; resolve it with --decide <step_id>=rerun or --decide <step_id>=skip, then resume again. Each decision authorizes exactly one attempt and does not carry forward.

Which provider should I use for CAO workflow steps?

Prefer claude_code as the step provider because it runs headless. The kiro_cli provider currently launches an interactive TUI that hangs run_step, though this is interim guidance pending a tracked fix.