Skip to content

Add workflow deploy gates to the Python SDK and CLI - #579

Draft
joaomarcoscrs wants to merge 4 commits into
mainfrom
joao/workflow-deploy-gates
Draft

joaomarcoscrs wants to merge 4 commits into
mainfrom
joao/workflow-deploy-gates

Conversation

@joaomarcoscrs

@joaomarcoscrs joaomarcoscrs commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

roboflow/roboflow#18337 added deploy gates and roboflow/roboflow#18948 added the manual approval type. A gated workflow publishes only a saved version that passed every gate, so updateWorkflow answers 409 deploy_check_required and saves nothing. The SDK surfaced that as a RoboflowError holding raw JSON.

update_workflow now raises WorkflowDeployGateError, a RoboflowError subclass with code, gate_types and next_steps, so existing except RoboflowError code still works. No public signature changes.

Workspace.workflow_deploy_gates() wraps the /workspaces/:ws/workflows API: save_version (never publishes), run, get_version / wait_for_version, deploy, the Eval gate, and the approval rules and reads. Approvers still decide in the app, and the server refuses a plain API key that changes the rules. The CLI gets workflow version save, workflow deploy-gates ... and a real workflow deploy in place of the hidden stub. run --wait and status --wait exit 1 unless the version is publishable, so they chain with &&.

The version argument is named workflow_version because SortedGroup sorts positional arguments alphabetically.

  • Unit tests for the client routes, the updateWorkflow refusal and the CLI, with HTTP mocked by responses; full suite and make check_code_quality on Python 3.10 at a7cd94d.
  • Not run against staging or prod.
  • The docs.roboflow.com CLI reference is not updated yet.

A workflow with a deploy gate no longer publishes through updateWorkflow, so
add a client for the gates API (save a version, run its checks, deploy it,
manage the Eval gate) and raise a typed error with the server's next steps
when updateWorkflow is refused.
roboflow/roboflow#18948 added a manual_approval gate. The client and CLI can now set, read and remove its rules and read version approvals; approvers still decide in the app.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant