Add project and agent privileges to Duo Workflow Event GraphQL API
What does this MR do and why?
This MR adds a number of fields to the Duo Workflow Workflow GraphQL call including:
- Adds Project information (used in AI Gateway to send project info to LLM)
- Adds First checkpoint (used in AI Gateway to identify current state of workflow)
- Workflow Status (used in AI Gateway to identify current state of workflow)
- Filter to filter by workflowId
- Agent privileges and pre-approved privileges
In addition to the fields I've also added the necessary scopes so that we can call the API from the Duo Workflow Service (in AI Gateway) which uses a token with a specific scope. Similar changes were done in a different MR as well.
All these changes are been done to reduce the number of HTTP calls required to start a workflow in order to improve performance.
References
Related issue: Issue Related Workflow Service MR (needs to be merged after this one): MR
Screenshots or screen recordings
| Before | After | 
|---|---|
How to set up and validate locally
- Run the following graphQL in graphql explorer http://gdk.test:3000/-/graphql-explorer
query($workflowId: AiDuoWorkflowsWorkflowID!) {
      duoWorkflowWorkflows(workflowId: $workflowId) {
        nodes {
          status
          project {
            id
            name
            httpUrlToRepo
            webUrl
          }
          agentPrivilegesNames
          preApprovedAgentPrivilegesNames
          mcpEnabled
          allowAgentToRequestUser
        }
      }
    }- You should see the project and the workflow details.
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.
Edited  by Shekhar Patnaik