Add the capability to trigger Duo flow execution on the AI catalog
What does this MR do and why?
This MR adds a mutation to execute Duo flow. Currently, the Duo workflow service does not have the ability to receive flow YAML configuration via API. Therefore, this mutation will return a YAML-based string, and we need to copy and paste it into the Duo workflow service manually in order to execute it.
Input Parameters:
- agentId (required)
- versionId (optional) - If provided, the specified agent version will be used; otherwise, the latest version will be used.
mutation {
aiCatalogAgentExecute(input: {
agentId: "gid://gitlab/Ai::Catalog::Item/41",
agentVersionId: "gid://gitlab/Ai::Catalog::ItemVersion/40"
}) {
errors
flowConfig
}
}
Response :
{
"data": {
"aiCatalogAgentExecute": {
"errors": [],
"flowConfig": "---\nversion: experimental\nenvironment: remote\ncomponents:\n- name: '41'\n type: AgentComponent\n prompt_id: workflow_catalog\n prompt_version: \"^1.0.0\"\n inputs:\n - context:goal\n output: context:agent.answer\n toolset:\n - gitlab_blob_search\n - ci_linter\n - gitlab_commit_search\n - edit_file\n ui_log_events:\n - on_tool_execution_success\n - on_agent_final_answer\n - on_tool_execution_failed\nrouters:\n- from: '41'\n to: end\nflow:\n entry_point: '41'\n"
}
},
"correlationId": "01K2CHTYR8J2GKV11J4V7QM7BF"
}
This site can be used to format YAML config - https://dadroit.com/string-to-yaml/
Related to #560129 (closed)
Edited by Jaydip Pansuriya