template_get_workflow_status
Check the current status of a workflow by providing its workflow ID. Returns workflow state information.
Instructions
[API] Get the status of a workflow
⚡️ Best for: ✓ Checking workflow status
⚠️ Not for: × Creating new services
→ Next steps: service_info
→ Related: template_list, template_deploy
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| workflowId | Yes | ID of the workflow to get the status of |
Implementation Reference
- Service method that handles the workflow status check logic. Calls the API repo, interprets the response, and returns a success/error message.
async getWorkflowStatus(workflowId: string) { const response = await this.client.templates.getWorkflowStatus(workflowId); if (response.error) { return createErrorResponse(`Error with workflow ${workflowId}: ${response.error}`); } if (response.status.toLowerCase() === 'complete') { return createSuccessResponse({ text: `Workflow ${workflowId} completed successfully`, data: response }); } return createSuccessResponse({ text: `Workflow ${workflowId} is still running. Status: ${response.status}`, data: response }); } - src/tools/template.tool.ts:82-84 (schema)Zod schema defining the input parameter: workflowId (string) is required.
{ workflowId: z.string().describe("ID of the workflow to get the status of") }, - src/tools/template.tool.ts:70-88 (registration)Tool registration using createTool with name 'template_get_workflow_status', description, schema, and handler.
createTool( "template_get_workflow_status", formatToolDescription({ type: 'API', description: "Get the status of a workflow", bestFor: ["Checking workflow status"], notFor: ["Creating new services"], relations: { nextSteps: ["service_info"], related: ["template_list, template_deploy"] } }), { workflowId: z.string().describe("ID of the workflow to get the status of") }, async ({ workflowId }) => { return templatesService.getWorkflowStatus(workflowId); } ), - Low-level API repository method that executes the GraphQL query to get workflow status from the Railway API.
async getWorkflowStatus(workflowId: string) { const query = ` query workflowStatus($workflowId:String!){ workflowStatus(workflowId:$workflowId) { status error } } `; const response = await this.client.request<{ workflowStatus: { status: string, error: string | null } }>(query, { workflowId }); return response.workflowStatus; }