Skip to main content
Glama

start_workflow

Initiate a workflow execution with step-by-step control, enabling structured and customizable task management through the MCP workflow server.

Instructions

Start a workflow execution session with step-by-step control

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes
inputsNo

Implementation Reference

  • The primary handler function that executes the start_workflow tool. It retrieves the specified workflow, validates inputs, initializes a new execution session tracking variables and step progress, and generates instructions for the first workflow step.
    private async startWorkflow(args: unknown) { const parsed = StartWorkflowSchema.parse(args); const workflow = await this.storage.get(parsed.id); if (!workflow) { throw new Error(`Workflow not found: ${parsed.id}`); } if (workflow.is_deleted) { throw new Error('Cannot run deleted workflow'); } // Validate inputs const inputs = parsed.inputs || {}; const inputValidation = WorkflowValidator.validateInputs(workflow, inputs); if (!inputValidation.success) { throw new Error(`Input validation failed: ${inputValidation.error}`); } // Create new execution session const executionId = uuidv4(); const session: WorkflowSession = { workflow_id: workflow.id, execution_id: executionId, workflow_name: workflow.name, current_step_index: 0, total_steps: workflow.steps.length, variables: { ...inputs }, status: 'active', started_at: new Date().toISOString(), step_outputs: {}, previous_variables: {}, }; this.sessions.set(executionId, session); // Generate instructions for the first step const firstStep = workflow.steps[0]; const stepInstructions = this.generateStepInstructions(workflow, firstStep, session); return { content: [ { type: 'text', text: stepInstructions, }, ], }; }
  • Zod schema defining the input structure for the start_workflow tool: a required workflow ID string and optional inputs object.
    const StartWorkflowSchema = z.object({ id: z.string(), inputs: z.record(z.any()).optional(), });
  • src/index.ts:277-281 (registration)
    Tool registration in the getTools() method, defining the name, description, and input schema for the MCP tool list.
    { name: 'start_workflow', description: 'Start a workflow execution session with step-by-step control', inputSchema: zodToJsonSchema(StartWorkflowSchema), },
  • src/index.ts:132-133 (registration)
    Dispatch registration in the CallToolRequestSchema handler switch statement, routing 'start_workflow' calls to the startWorkflow method.
    case 'start_workflow': return await this.startWorkflow(args);

Other Tools

Related Tools

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/FiveOhhWon/workflows-mcp'

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