POST
/v1/data-flowsbetaapiKeyworkspace
When to use
Create a flow for an external agent to build.
For agents
Creates a draft without invoking an AI build. Add operations through graph commands, then save their code and test them.
Example
import { PermuteClient } from '@permute/sdk';
const orgClient = new PermuteClient({
apiKey: process.env.PERMUTE_API_KEY!,
});
const client = orgClient.withWorkspace(process.env.PERMUTE_WORKSPACE_ID!);
const result = await client.dataFlows.create({
"name": "Revenue flow",
"description": "Revenue by customer",
"dataSourceIds": [
"data_abc123"
]
});Request body
{
"name": "Revenue flow",
"description": "Revenue by customer",
"dataSourceIds": [
"data_abc123"
]
}Response
{
"data": {
"operation": {
"id": "oper_flow123",
"name": "Revenue flow",
"kind": "dataFlow",
"instructions": "Sum revenue by customer.",
"dataSourceIds": [
"data_abc123"
],
"parentDataFlowId": null,
"status": "draft",
"codeStale": false,
"draft": null,
"published": null
},
"revision": 0,
"draftVersion": 1,
"publishedVersion": null,
"operationIds": [],
"sourceIds": [
"data_abc123"
],
"edges": []
}
}