Executions Commands

Inspect workflow, task, and agent executions with usage summaries.

Overview

The compozy executions sub-commands surface real-time execution status, outputs, and the new LLM usage summaries. All commands support human-friendly table output as well as machine-readable JSON for automation.

Workflow Executions

Usage

compozy executions workflows get <workflow-exec-id> [flags]

Examples

# Show a workflow execution in the interactive table view
compozy executions workflows get 01JZMB7Z1B6KM0J6R2AVB59S4A

# Stream updates until completion
compozy executions workflows get 01JZMB7Z1B6KM0J6R2AVB59S4A --follow

Task Executions

Usage

compozy executions tasks get <task-exec-id> [flags]

Examples

# Fetch task execution details with usage metrics
compozy executions tasks get 01JZMB8ADP1T3QCW1SBBCX9KHF --format json --pretty

# Filter down to just the usage object
compozy executions tasks get 01JZMB8ADP1T3QCW1SBBCX9KHF \
  --format json | jq '.usage'

Tip: The usage object matches the Execution Usage Schema, making it straightforward to push into billing or analytics pipelines.

Agent Executions

Usage

compozy executions agents get <agent-exec-id> [flags]

Examples

# Display an agent execution with the new usage summary field
compozy executions agents get 01JZMB8Z7F7T25N1M1SC1JW4S2 --format json | jq '.usage'

Streaming From the API

The CLI --follow flag polls periodically. Use the REST streaming endpoints when you need sub-second updates, resumable processing, or custom rendering pipelines.

const execId = process.argv[2];
const stream = new EventSource(
  `${process.env.COMPOZY_BASE_URL}/api/v0/executions/tasks/${execId}/stream`
);

stream.addEventListener("task_status", event => {
  const payload = JSON.parse(event.data);
  console.log("Task status:", payload.status, "-", payload.component);
});

stream.addEventListener("llm_chunk", event => {
  process.stdout.write(event.data);
});

stream.addEventListener("complete", () => {
  stream.close();
  console.log("\nExecution completed.");
});

Resume tip: Persist the last id: you processed and send it back through Last-Event-ID to continue a workflow stream without duplicates.

Filtering & Formats

All execution commands support the common flags:

FlagDescription
--format jsonEmit JSON output suitable for automation.
--prettyPretty-print JSON responses.
--followStream execution updates until completion.
--quietSuppress progress logs in script mode.