Retrieve a workflow run plan
/api/v1/workflows/runs/{run_id}/planRetrieve the workflow run's current definition, immutable plan-version history, recent step-review history, and any pending post-step review. Capability flags say whether this caller is the designated reviewer or the run initiator.
reviews contains the latest 100 reviews in chronological order. Use review_count and reviews_truncated to detect older history.
This is distinct from /runs/{run_id}/plan, which controls an individual agent run's tool-governance plan.
Required access
Credentials: automation account, delegated token, user session, user API key
User API keys use the owner’s current permissions, subject to any key restrictions. Capability scopes below apply to automation account keys and delegated tokens.
Scope: workflows:read
The caller must be able to read both the workflow run and its saved workflow. A private workflow's definition is not exposed merely because its run is organization-readable.
A user-owned key prefixed gsmc_uk_, bound to one organization. It follows its owner's current membership, role and resource permissions, optionally restricted to read-only access. No X-Org-Id header is needed; a conflicting organization is rejected. Credential creation, personal connection setup and human attestations require a signed-in session. Runs are private to the calling user; sharing an agent grants access to your own personal memory of it, never to the agent's own memory.
In: header
Path Parameters
Header Parameters
Selects the active organization for a direct user session that has more than one membership. Automation account keys and delegated tokens are each bound to one organization and ignore it.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X GET "https://example.com/api/v1/workflows/runs/0/plan" \ -H "Authorization: Bearer $GUEST_MACHINES_API_KEY"{ "version": 0, "definition": { "steps": [ { "key": "string", "name": "string", "run_if": "string", "on_error": { "action": "continue", "max_attempts": 3, "backoff": "exponential", "backoff_delay_seconds": 1, "fallback_agent_id": "ea74c5a8-d285-4937-959b-1e318178db0b" }, "limits": { "max_duration_seconds": 1 }, "files": [ { "source": { "kind": "input", "input_alias": "string", "step": "string", "selector": { "file_name": "string", "primary": true }, "iteration": 1 }, "target_alias": "string", "required": true } ], "kind": "agent", "agent_id": "2b1e3b65-2c04-4fa2-a2d7-467901e98978", "instruction": "string", "input": {}, "responder_user_id": "0f708b4a-8382-4a27-a010-8a6f70d21699" } ], "loop": { "from_step": "string", "until": "string", "max_iterations": 3 }, "output": null, "review_after_steps": false }, "versions": [ { "version": 0, "parent_version": 0, "operation": "append", "review_id": "30a1a187-4023-4077-a8f3-f5ec83d3ab6b", "reason": "string", "created_by_user_id": "209f54c4-4c33-43bc-9c6a-ef4c65ad7473", "created_by_service_principal_id": "632f5796-7464-468a-9dc3-9734cb79d1af", "created_at": "2019-08-24T14:15:22Z" } ], "reviews": [ { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "workflow_run_step_id": 0, "step_key": "string", "step_index": 0, "step_kind": "agent", "review_round": 0, "plan_version": 0, "reviewer_user_id": "f624c54b-252a-4ffd-965c-527b0a3ed08d", "status": "cancelled", "decision": "approve", "feedback": "string", "applied_plan_version": 0, "responded_by_user_id": "0cddcf68-90fa-4e26-8c15-e4f34c3446b0", "responded_by_service_principal_id": "6a6dea7e-e2f3-4659-9fd3-ef77f51e5c93", "created_at": "2019-08-24T14:15:22Z", "resolved_at": "2019-08-24T14:15:22Z" } ], "review_count": 0, "reviews_truncated": false, "pending_review": { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "workflow_run_step_id": 0, "step_key": "string", "step_index": 0, "step_kind": "agent", "review_round": 0, "plan_version": 0, "reviewer_user_id": "f624c54b-252a-4ffd-965c-527b0a3ed08d", "created_at": "2019-08-24T14:15:22Z" }, "can_respond": false, "can_edit_plan": false}