kifas.workflow.extract_to_subworkflow
kifas.workflow.extract_to_subworkflow
Section titled “kifas.workflow.extract_to_subworkflow”PR 4 — group N selected nodes into a new sub-workflow, n8n-style. The parent’s graph is mutated to replace the selected nodes with a single first-class sub_workflow ref node pinned at the new sub-workflow’s v0.1.0. Inputs/outputs are auto-detected at extraction time from \{\{ ... \}\} references that cross the selection boundary.
Required scopes: workflow:write
Parameters
Section titled “Parameters”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
workflow_id |
string |
yes | — | |
node_ids |
string[] |
yes | — | |
name |
string |
yes | — | |
description |
string |
no | — | |
scope |
"project"` | `"org" |
no | "project" |
|
add_manual_trigger |
boolean |
no | false |
|
if_match |
string |
yes | — |
Returns
Section titled “Returns”{ "type": "object", "properties": { "new_workflow_id": { "type": "string", "format": "uuid", "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$" }, "version": { "type": "string" }, "parent_replacement_node_id": { "type": "string" }, "detected_inputs": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "string" } }, "detected_outputs": { "type": "object", "propertyNames": { "type": "string" }, "additionalProperties": { "type": "string" } } }, "required": [ "new_workflow_id", "version", "parent_replacement_node_id", "detected_inputs", "detected_outputs" ], "additionalProperties": false}Code samples
Section titled “Code samples”TypeScript (Anthropic MCP SDK)
import { Client } from '@modelcontextprotocol/sdk/client/index.js'import { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/client/streamable-http.js'
const transport = new StreamableHTTPClientTransport( new URL('https://mcp.kifas.io/'), { requestInit: { headers: { Authorization: `Bearer ${process.env.KIFAS_API_KEY}` }, }, },)const client = new Client({ name: 'demo', version: '0.1.0' })await client.connect(transport)
const result = await client.callTool({ name: 'kifas.workflow.extract_to_subworkflow', arguments: { "workflow_id": "00000000-0000-0000-0000-000000000000", "node_ids": [], "name": "", "scope": "project", "add_manual_trigger": false, "if_match": "" },})console.log(result)Python (httpx, raw JSON-RPC)
import osimport httpx
resp = httpx.post( "https://mcp.kifas.io/", headers={ "Authorization": f"Bearer {os.environ['KIFAS_API_KEY']}", "Content-Type": "application/json", }, json={ "jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": { "name": "kifas.workflow.extract_to_subworkflow", "arguments": { "workflow_id": "00000000-0000-0000-0000-000000000000", "node_ids": [], "name": "", "scope": "project", "add_manual_trigger": false, "if_match": "" }, }, },)print(resp.json())curl
curl https://mcp.kifas.io/ \ -H "Authorization: Bearer $KIFAS_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": { "name": "kifas.workflow.extract_to_subworkflow", "arguments": { "workflow_id": "00000000-0000-0000-0000-000000000000", "node_ids": [], "name": "", "scope": "project", "add_manual_trigger": false, "if_match": "" } }}'Raw JSON-RPC body
{ "jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": { "name": "kifas.workflow.extract_to_subworkflow", "arguments": { "workflow_id": "00000000-0000-0000-0000-000000000000", "node_ids": [], "name": "", "scope": "project", "add_manual_trigger": false, "if_match": "" } }}Try it
Section titled “Try it”Want to try kifas.workflow.extract_to_subworkflow? Sign in to the dashboard and run it against a real session.