Skip to main content
Glama

create_task_definition

Create or update task definitions in Netflix Conductor workflow engine to define workflow components and their execution logic.

Instructions

Create or update a task definition. If the task already exists, it will be updated.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
definitionYesComplete task definition as a JSON object

Implementation Reference

  • The switch case implementing the core logic of the 'create_task_definition' tool: extracts the 'definition' from input arguments, sends a POST request to Conductor API endpoint '/metadata/taskdefs' with the definition in an array, and returns a success text message.
    case "create_task_definition": { const { definition } = args as any; await conductorClient.post("/metadata/taskdefs", [definition]); return { content: [ { type: "text", text: `Task definition created/updated successfully.`, }, ], }; }
  • Tool definition including name, description, and inputSchema specifying that a 'definition' object is required.
    { name: "create_task_definition", description: "Create or update a task definition. If the task already exists, it will be updated.", inputSchema: { type: "object", properties: { definition: { type: "object", description: "Complete task definition as a JSON object", }, }, required: ["definition"], }, },
  • src/index.ts:34-419 (registration)
    The 'tools' array includes the 'create_task_definition' tool definition, which is returned by the ListToolsRequest handler to register the tool with the MCP server.
    const tools: Tool[] = [ { name: "list_workflows", description: "List workflow executions with optional filters. Returns a list of workflow executions matching the criteria.", inputSchema: { type: "object", properties: { workflowName: { type: "string", description: "Filter by workflow name/type", }, status: { type: "string", description: "Filter by workflow status (RUNNING, COMPLETED, FAILED, TIMED_OUT, TERMINATED, PAUSED)", enum: ["RUNNING", "COMPLETED", "FAILED", "TIMED_OUT", "TERMINATED", "PAUSED"], }, startTime: { type: "number", description: "Filter workflows started after this time (epoch milliseconds)", }, endTime: { type: "number", description: "Filter workflows started before this time (epoch milliseconds)", }, freeText: { type: "string", description: "Free text search across workflow executions", }, }, }, }, { name: "get_workflow_status", description: "Get the current status and details of a specific workflow execution by its ID. Returns complete workflow execution details including tasks, input/output, and current status.", inputSchema: { type: "object", properties: { workflowId: { type: "string", description: "The unique workflow execution ID", }, includeTaskDetails: { type: "boolean", description: "Include detailed task information (default: true)", }, }, required: ["workflowId"], }, }, { name: "start_workflow", description: "Start a new workflow execution. Returns the workflow execution ID of the newly started workflow.", inputSchema: { type: "object", properties: { workflowName: { type: "string", description: "Name of the workflow to start", }, version: { type: "number", description: "Version of the workflow (optional, defaults to latest)", }, input: { type: "object", description: "Input parameters for the workflow as a JSON object", }, correlationId: { type: "string", description: "Optional correlation ID for tracking", }, priority: { type: "number", description: "Workflow execution priority (0-99, default: 0)", }, }, required: ["workflowName"], }, }, { name: "pause_workflow", description: "Pause a running workflow execution. The workflow will pause and can be resumed later.", inputSchema: { type: "object", properties: { workflowId: { type: "string", description: "The workflow execution ID to pause", }, }, required: ["workflowId"], }, }, { name: "resume_workflow", description: "Resume a paused workflow execution. The workflow will continue from where it was paused.", inputSchema: { type: "object", properties: { workflowId: { type: "string", description: "The workflow execution ID to resume", }, }, required: ["workflowId"], }, }, { name: "terminate_workflow", description: "Terminate a workflow execution. This will stop the workflow and mark it as terminated.", inputSchema: { type: "object", properties: { workflowId: { type: "string", description: "The workflow execution ID to terminate", }, reason: { type: "string", description: "Reason for termination", }, }, required: ["workflowId"], }, }, { name: "restart_workflow", description: "Restart a workflow execution from the beginning. This creates a new execution with the same input.", inputSchema: { type: "object", properties: { workflowId: { type: "string", description: "The workflow execution ID to restart", }, useLatestDefinition: { type: "boolean", description: "Use the latest workflow definition (default: false)", }, }, required: ["workflowId"], }, }, { name: "retry_workflow", description: "Retry a failed workflow execution from the last failed task.", inputSchema: { type: "object", properties: { workflowId: { type: "string", description: "The workflow execution ID to retry", }, resumeSubworkflowTasks: { type: "boolean", description: "Resume subworkflow tasks (default: false)", }, }, required: ["workflowId"], }, }, { name: "search_workflows", description: "Advanced search for workflow executions using query syntax. Supports complex queries with multiple criteria.", inputSchema: { type: "object", properties: { query: { type: "string", description: "Query string (e.g., 'workflowType=MyWorkflow AND status=FAILED')", }, start: { type: "number", description: "Start index for pagination (default: 0)", }, size: { type: "number", description: "Number of results to return (default: 100)", }, sort: { type: "string", description: "Sort field and order (e.g., 'startTime:DESC')", }, }, required: ["query"], }, }, { name: "get_workflow_definition", description: "Get the definition of a workflow by name and version. Returns the complete workflow definition including all tasks and configuration.", inputSchema: { type: "object", properties: { workflowName: { type: "string", description: "Name of the workflow", }, version: { type: "number", description: "Version of the workflow (optional, defaults to latest)", }, }, required: ["workflowName"], }, }, { name: "list_workflow_definitions", description: "List all registered workflow definitions. Returns metadata about all workflows registered in Conductor.", inputSchema: { type: "object", properties: { access: { type: "string", description: "Filter by access type (READ or CREATE)", enum: ["READ", "CREATE"], }, tagKey: { type: "string", description: "Filter by tag key", }, tagValue: { type: "string", description: "Filter by tag value", }, }, }, }, { name: "create_workflow_definition", description: "Create or update a workflow definition. If the workflow already exists, it will be updated.", inputSchema: { type: "object", properties: { definition: { type: "object", description: "Complete workflow definition as a JSON object", }, overwrite: { type: "boolean", description: "Overwrite existing definition (default: true)", }, }, required: ["definition"], }, }, { name: "get_task_details", description: "Get details of a specific task execution by task ID. Returns task status, input/output, and execution details.", inputSchema: { type: "object", properties: { taskId: { type: "string", description: "The unique task execution ID", }, }, required: ["taskId"], }, }, { name: "get_task_logs", description: "Get execution logs for a specific task. Returns log entries generated during task execution.", inputSchema: { type: "object", properties: { taskId: { type: "string", description: "The unique task execution ID", }, }, required: ["taskId"], }, }, { name: "update_task_status", description: "Update the status of a task execution. This is typically used by workers to update task status.", inputSchema: { type: "object", properties: { taskId: { type: "string", description: "The unique task execution ID", }, workflowInstanceId: { type: "string", description: "The workflow instance ID", }, status: { type: "string", description: "New task status", enum: ["IN_PROGRESS", "FAILED", "FAILED_WITH_TERMINAL_ERROR", "COMPLETED"], }, output: { type: "object", description: "Task output data", }, logs: { type: "array", description: "Task execution logs", items: { type: "object", }, }, }, required: ["taskId", "workflowInstanceId", "status"], }, }, { name: "get_task_definition", description: "Get the definition of a task by name. Returns the task definition including configuration and metadata.", inputSchema: { type: "object", properties: { taskName: { type: "string", description: "Name of the task", }, }, required: ["taskName"], }, }, { name: "list_task_definitions", description: "List all registered task definitions. Returns metadata about all tasks registered in Conductor.", inputSchema: { type: "object", properties: { access: { type: "string", description: "Filter by access type (READ or CREATE)", enum: ["READ", "CREATE"], }, }, }, }, { name: "create_task_definition", description: "Create or update a task definition. If the task already exists, it will be updated.", inputSchema: { type: "object", properties: { definition: { type: "object", description: "Complete task definition as a JSON object", }, }, required: ["definition"], }, }, { name: "get_event_handlers", description: "Get all event handlers or filter by event and active status. Event handlers define how Conductor responds to external events.", inputSchema: { type: "object", properties: { event: { type: "string", description: "Filter by event name", }, activeOnly: { type: "boolean", description: "Return only active event handlers (default: true)", }, }, }, }, ];

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/opensensor/conductor-mcp'

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