published fresh until

Copilot CLI: how do I script a repeatable multi-step agent run?

Summary As of October 2026, GitHub's dynamic workflows (public preview, 1 Oct 2026) let you define a multi-step, parallel agent process as a Copilot extension and run it with copilot workflow run, including in CI. Set permissions and credit limits up front.

Not for running Claude Code, Codex or Copilot as a GitHub Actions Markdown workflow; see github-agentic-workflows-gh-aw

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

The problem

Prompting an agent step by step is not repeatable. You want a fixed process (run checks, split work in parallel, have agents verify each other, pause for review) that behaves the same on every run and can run from a script or CI.

What it is

GitHub's changelog of 1 Oct 2026 introduced dynamic workflows for Copilot CLI, the Copilot app and the SDK, in public preview. A workflow is a program that mixes ordinary commands with agent work, in sequence or parallel, passes structured results between stages and can pause at checkpoints. The process is defined in code rather than left to the model to improvise (the docs page does not itself contrast it with /fleet).

How to use it (per the docs)

  • Enable: start the CLI with --experimental or run /experimental on.
  • Define: workflows live as Copilot extensions (an extension.mjs in a named folder) in ~/.copilot/extensions/ (personal) or .github/extensions/ (repository). You can ask Copilot to write one from a description; creating it does not run it. The docs point to built-in guidance for the file format rather than documenting it in full.
  • Run in a session by name, or from a terminal: copilot workflow run NAME --args @input.json --allow-tool=read --result-file out.json.
  • CI: set up authentication first (for example COPILOT_GITHUB_TOKEN), grant every permission up front (there are no prompts; requests that cannot be auto-approved are denied). The docs' example adds --silent --output-format json.
  • Manage: /workflows lists runs (pause, cancel, resume); /every and /after schedule a run.

Cautions

  • Preview: expect changes. Set AI credit limits; resuming a run that hit its limit needs a higher total, and earlier usage still counts.
  • Canceled runs cannot be resumed; unsaved work may repeat on resume.
  • GITHUB_COPILOT_PROMPT_MODE_EXTENSIONS=true lets repository extension code run in an untrusted directory, so use it only for code you trust.
  • Review a workflow's extension code like any other script before putting it in CI.

Sources: GitHub changelog, 1 Oct 2026, GitHub docs: Use dynamic workflows.

Primary source

Primary sources: GitHub changelog, 1 Oct 2026 and GitHub docs, Use dynamic workflows (GitHub). Checked: dated 1 October 2026, public preview and subject to change, available in Copilot CLI, the Copilot app and the SDK; a workflow is code in a Copilot extension that mixes commands and agent work in sequence or parallel, passes structured results and pauses at checkpoints; --experimental or /experimental on; extension.mjs in ~/.copilot/extensions/ or .github/extensions/; --args, --allow-tool=read and --result-file; CI with COPILOT_GITHUB_TOKEN, no prompts and denial of requests that cannot be auto-approved, --silent --output-format json; /workflows pause, cancel and resume; /every and /after; higher total needed to resume after a credit limit; canceled runs cannot be resumed; GITHUB_COPILOT_PROMPT_MODE_EXTENSIONS=true risk. Correction made above: the docs page does not mention /fleet, so the thread's claim that the docs contrast the two was removed. Verified: the docs show --args, --result-file and --allow-tool=read together in one copilot workflow run command.

Started from a post by @GitHub, packaged by the editor. Original post

Subjects

More in agent workflows

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Copilot CLI: how do I script a repeatable multi-step agent run?
Summary: As of October 2026, GitHub's dynamic workflows (public preview, 1 Oct 2026) let you define a multi-step, parallel agent process as a Copilot extension and run it with `copilot workflow run`, including in CI. Set permissions and credit limits up front.
Copy for agent
get the whatworks thread copilot-dynamic-workflows-scripted-agent-runs and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread copilot-dynamic-workflows-scripted-agent-runs
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks