create_task_workflow
Build multi-step task workflows with dependencies and priorities to organize project execution within the Helios-9 project management system.
Instructions
Create a workflow with multiple connected tasks
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | Yes | ID of the project | |
| workflow_name | Yes | Name of the workflow | |
| tasks | Yes | Array of tasks to create in the workflow | |
| auto_start | No | Whether to automatically start the first tasks |
Implementation Reference
- src/tools/tasks.ts:680-745 (handler)The main execution handler for the 'create_task_workflow' tool. Parses input, creates multiple tasks in sequence, sets up dependencies between them, and optionally prepares first tasks.export const createTaskWorkflow = requireAuth(async (args: any) => { const { project_id, workflow_name, tasks, auto_start } = CreateTaskWorkflowSchema.parse(args) logger.info('Creating task workflow', { project_id, workflow_name, task_count: tasks.length }) const createdTasks = [] const taskMap = new Map() // Map task index to created task ID // Create all tasks first for (let i = 0; i < tasks.length; i++) { const taskData = tasks[i] const task = await supabaseService.createTask({ title: taskData.title, description: taskData.description || null, project_id, initiative_id: null, status: 'todo', priority: taskData.priority, assignee_id: taskData.assignee_id || null, due_date: null // Removed metadata as it doesn't exist in the database schema }) createdTasks.push(task) taskMap.set(i, task.id) } // Create dependencies const dependencies = [] for (let i = 0; i < tasks.length; i++) { const taskData = tasks[i] const currentTaskId = taskMap.get(i)! for (const dependsOnIndex of taskData.depends_on) { if (dependsOnIndex < i) { // Only allow dependencies on previous tasks const dependsOnTaskId = taskMap.get(dependsOnIndex)! const dependency = await supabaseService.createTaskDependency({ task_id: currentTaskId, depends_on_task_id: dependsOnTaskId, dependency_type: 'blocks' }) dependencies.push(dependency) } } } // Auto-start first tasks if requested if (auto_start) { const firstTasks = createdTasks.filter((_, index) => tasks[index].depends_on.length === 0) for (const task of firstTasks) { await supabaseService.updateTask(task.id, { status: 'todo', updated_at: new Date().toISOString() }) } } return { workflow_name, tasks_created: createdTasks.length, dependencies_created: dependencies.length, tasks: createdTasks, dependencies, ready_tasks: auto_start ? createdTasks.filter((_, i) => tasks[i].depends_on.length === 0).length : 0 } })
- src/tools/tasks.ts:666-678 (schema)Zod validation schema for the input parameters of the create_task_workflow tool.const CreateTaskWorkflowSchema = z.object({ project_id: z.string().min(1), workflow_name: z.string().min(1), tasks: z.array(z.object({ title: z.string().min(1), description: z.string().optional(), assignee_id: z.string().optional(), priority: z.enum(['low', 'medium', 'high']).default('medium'), estimated_hours: z.number().positive().optional(), depends_on: z.array(z.number()).default([]) })).min(1), auto_start: z.boolean().default(false) })
- src/tools/tasks.ts:622-664 (registration)MCPTool object definition for 'create_task_workflow', including name, description, and JSON schema for inputs.export const createTaskWorkflowTool: MCPTool = { name: 'create_task_workflow', description: 'Create a workflow with multiple connected tasks', inputSchema: { type: 'object', properties: { project_id: { type: 'string', description: 'ID of the project' }, workflow_name: { type: 'string', description: 'Name of the workflow' }, tasks: { type: 'array', items: { type: 'object', properties: { title: { type: 'string' }, description: { type: 'string' }, assignee_id: { type: 'string' }, priority: { type: 'string', enum: ['low', 'medium', 'high'] }, estimated_hours: { type: 'number' }, depends_on: { type: 'array', items: { type: 'number' }, description: 'Array of task indices this task depends on' } }, required: ['title'] }, description: 'Array of tasks to create in the workflow' }, auto_start: { type: 'boolean', default: false, description: 'Whether to automatically start the first tasks' } }, required: ['project_id', 'workflow_name', 'tasks'] } }
- src/tools/tasks.ts:1157-1167 (registration)Registration of the createTaskWorkflow handler function in the taskHandlers export map, mapping tool name to handler.export const taskHandlers = { list_tasks: listTasks, create_task: createTask, get_task: getTask, update_task: updateTask, add_task_dependency: addTaskDependency, get_task_dependencies: getTaskDependencies, create_task_workflow: createTaskWorkflow, bulk_update_tasks: bulkUpdateTasks, get_task_workflow_status: getTaskWorkflowStatus }
- src/tools/tasks.ts:1145-1155 (registration)Inclusion of createTaskWorkflowTool in the taskTools export object.export const taskTools = { listTasksTool, createTaskTool, getTaskTool, updateTaskTool, addTaskDependencyTool, getTaskDependenciesTool, createTaskWorkflowTool, bulkUpdateTasksTool, getTaskWorkflowStatusTool }