update_flow_status
Change the status of a Klaviyo marketing automation flow to draft, manual, or live to control campaign execution.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ID of the flow to update | |
| status | Yes | New status for the flow |
Implementation Reference
- src/tools/flows.js:58-79 (handler)Handler function that updates the flow status by sending a PATCH request to Klaviyo API with the new status.async (params) => { try { const payload = { data: { type: "flow", id: params.id, attributes: { status: params.status } } }; const result = await klaviyoClient.patch(`/flows/${params.id}/`, payload); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: `Error updating flow status: ${error.message}` }], isError: true }; }
- src/tools/flows.js:54-57 (schema)Zod schema defining input parameters: flow ID and status (draft, manual, live).{ id: z.string().describe("ID of the flow to update"), status: z.enum(["draft", "manual", "live"]).describe("New status for the flow") },
- src/tools/flows.js:52-82 (registration)Registration of the 'update_flow_status' tool using server.tool, including schema, handler, and description.server.tool( "update_flow_status", { id: z.string().describe("ID of the flow to update"), status: z.enum(["draft", "manual", "live"]).describe("New status for the flow") }, async (params) => { try { const payload = { data: { type: "flow", id: params.id, attributes: { status: params.status } } }; const result = await klaviyoClient.patch(`/flows/${params.id}/`, payload); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: `Error updating flow status: ${error.message}` }], isError: true }; } }, { description: "Update the status of a flow in Klaviyo" } );