You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
workflows instances get/delete: no 'latest' instance ID alias #167
wrangler workflows instances describe <WORKFLOW_NAME> latest and wrangler workflows instances delete <WORKFLOW_NAME> latest accept latest as a convenience alias to target the most recently created instance.
In cf, cf workflows instances get <INSTANCE_ID> and cf workflows instances delete <INSTANCE_ID> pass <instance-id> directly to the REST API path (/instances/<instance-id>), so users have to run cf workflows instances list --workflow-name <NAME> first and copy an instance ID every time they test a Workflow run.
Expected behaviour
Support latest (or a --latest flag) on cf workflows instances get and cf workflows instances delete (and ideally status-change commands such as pause/resume/terminate) by resolving the most recent instance for --workflow-name:
cf workflows instances get latest --workflow-name my-workflow
# Resolves the most recently created instance ID for my-workflow and returns its status and step logs:# {# "id": "<LATEST_INSTANCE_ID>",# "status": "complete",# "steps": [...]# }
Reproduction
cf workflows instances get latest --workflow-name my-workflow --dry-run
Actual output (sends literal "latest" as the instance ID path parameter):
cf workflows instances get latest --workflow-name my-workflow sends latest unchanged, and the Workflows backend treats it as a literal instance ID. The ID doesn’t have to be a SHA; it can be a user-supplied string. (developers.cloudflare.com)
Wrangler resolves it client-side. wrangler workflows instances describe my-workflow latest (or just describe my-workflow) fetches the first page of instances, sorts it by created_on newest-first, and requests details using the first result’s actual ID. It errors if the list is empty. An explicit ID skips the list request. (raw.githubusercontent.com)
While it is tempting to try to fix this clientside for cf similar to what wrangler does, I think the correct fix is at the API level. Either with a new entrypoint or a param (e.g. --latest).
Activity
petebacondarwin commentedon Nov 20, 2026
cf workflows instances get latest --workflow-name my-workflowsendslatestunchanged, and the Workflows backend treats it as a literal instance ID. The ID doesn’t have to be a SHA; it can be a user-supplied string. (developers.cloudflare.com)Wrangler resolves it client-side.
wrangler workflows instances describe my-workflow latest(or justdescribe my-workflow) fetches the first page of instances, sorts it by created_on newest-first, and requests details using the first result’s actual ID. It errors if the list is empty. An explicit ID skips the list request. (raw.githubusercontent.com)petebacondarwin commentedon Nov 20, 2026
While it is tempting to try to fix this clientside for
cfsimilar to whatwranglerdoes, I think the correct fix is at the API level. Either with a new entrypoint or a param (e.g.--latest).