Workflow resume API
What does this MR do and why?
This merge request adds the ability to resume paused AI workflows that are waiting for human approval.
The main changes include:
- New API endpoint: Added a POST endpoint
/api/v4/ai/duo_workflows/workflows/{workflow_id}/resumethat allows users to provide approval decisions (approve/reject) along with optional messages when a workflow is paused and waiting for human input. - Resume functionality: Created a new
ResumeWorkflowServicethat extends the existing workflow start service to handle resuming paused workflows. It preserves previous workflow state and variables while adding the human approval decision and any accompanying message.
The feature enables a more interactive workflow experience where AI processes can pause for human review and approval before continuing with potentially sensitive operations.
References
Screenshots or screen recordings
| UI page | Screenshot/recording |
|---|---|
| Recording | https://drive.google.com/file/d/11mA62Wdo8kfcU4mnwTOJDT7EhSX_kXDf/view?usp=sharing |
| User Sessions | ![]() |
| Automate > Sessions | ![]() |
How to set up and validate locally
-
Use this branch
ss/spike-hitlfromgitlab-ai-gateway, which adds thehuman_inputcomponent to thedeveloper/experimentalflow -
Pull from this branch and apply this patch
diff --git a/ee/app/services/ai/duo_workflows/start_workflow_service.rb b/ee/app/services/ai/duo_workflows/start_workflow_service.rb index 5350bdc33963..356c3755e358 100644 --- a/ee/app/services/ai/duo_workflows/start_workflow_service.rb +++ b/ee/app/services/ai/duo_workflows/start_workflow_service.rb @@ -4,7 +4,7 @@ module Ai module DuoWorkflows class StartWorkflowService IMAGE_PATH = "gitlab-org/duo-workflow/default-docker-image/workflow-generic-image:v0.0.6" - DUO_CLI_VERSION = "8.77.0" + DUO_CLI_VERSION = "8.82.0" DWS_STANDARD_CONTEXT_CATEGORY = "agent_platform_standard_context" def initialize(workflow:, params:) @@ -254,7 +254,7 @@ def set_up_executor_commands "command -v duo > /dev/null 2>&1 && ", "echo \"duo-cli already present, skipping installation\" || ", "{ echo \"Installing @gitlab/duo-cli@#{DUO_CLI_VERSION}...\" && ", "npm install -g @gitlab/duo-cli@#{DUO_CLI_VERSION}; }" ].join cli_setup_commands = [ @@ -414,7 +414,7 @@ def resolve_developer_workflow(definition, project) Feature.enabled?(:duo_developer_next_compatible, project.root_ancestor) 'developer_next/experimental' else - definition + 'developer/experimental' end end -
Click on
Generate MR with Duobutton for any issue work item. It should start execution and then exit the workload job when it has created an implementation plan -
Your workflow should be marked as
input requiredin the UI -
Use below cURL to approve the implementation plan
curl --request POST \ --url http://gdk.test:3000/api/v4/ai/duo_workflows/workflows/$WORKFLOW_ID/resume \ --header 'Authorization: Bearer $PAT' \ --header 'content-type: application/json' \ --data '{"human_approval":true}' -
It should start a new workload job linked with the session and finish it to completion
-
You should see an MR linked at the of your session
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Related to #594413 (closed)

