Skip to main content
Glama

run_workflow

Execute security workflows in Kubernetes and cloud environments with customizable parameters to analyze and address security findings through the RAD Security platform.

Instructions

Run a workflow with optional argument overrides

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workflow_idYesID of the workflow to run
asyncNoIf true, run asynchronously and return immediately. If false, wait for the workflow to finish.
argsNoOptional arguments to override when running the workflow

Implementation Reference

  • Core handler function that executes the run_workflow tool: POSTs to start workflow run, handles async immediate return or sync polling until completion.
    export async function runWorkflow( client: RadSecurityClient, workflowId: string, async: boolean = true, args?: Record<string, any> ): Promise<any> { const body: Record<string, any> = {}; if (args) { body.args = args; } const response = await client.makeRequest( `/accounts/${client.getAccountId()}/workflows/${workflowId}/runs`, {}, { method: "POST", body: args??{} } ); if (!response || !response.id) { throw new Error(`Failed to run workflow ${workflowId}: no id in response`); } const runId = response.id; // If async, return immediately with the run_id if (async) { return { run_id: runId, status: "running", message: "Workflow started asynchronously" }; } // Otherwise, poll until the workflow is finished const pollInterval = 2000; // 2 seconds const maxWaitTime = 300000; // 5 minutes const startTime = Date.now(); while (true) { const runDetails = await getWorkflowRun(client, workflowId, runId); // Check if the workflow has finished const status = runDetails.status; if (status === "completed" || status === "failed" || status === "cancelled") { return runDetails; } // Check if we've exceeded the max wait time if (Date.now() - startTime > maxWaitTime) { throw new Error( `Workflow ${workflowId} run ${runId} did not finish within ${maxWaitTime / 1000} seconds. Last status: ${status}` ); } // Wait before polling again await new Promise(resolve => setTimeout(resolve, pollInterval)); } }
  • Input schema validation using Zod for the run_workflow tool parameters.
    export const RunWorkflowSchema = z.object({ workflow_id: z.string().describe("ID of the workflow to run"), async: z.boolean().default(true).describe("If true, run asynchronously and return immediately. If false, wait for the workflow to finish."), args: z.record(z.any()).optional().describe("Optional arguments to override when running the workflow"), });
  • src/index.ts:531-534 (registration)
    Tool registration in the list_tools response, defining name, description, and input schema.
    name: "run_workflow", description: "Run a workflow with optional argument overrides", inputSchema: zodToJsonSchema(workflows.RunWorkflowSchema), },
  • src/index.ts:1438-1452 (registration)
    Dispatch handler in call_tool request that parses args with schema and invokes the runWorkflow function.
    case "run_workflow": { const args = workflows.RunWorkflowSchema.parse( request.params.arguments ); const response = await workflows.runWorkflow( client, args.workflow_id, args.async, args.args ); return { content: [ { type: "text", text: JSON.stringify(response, null, 2) }, ], };

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/rad-security/mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server