PermuteDocs
Go to Permute

Data Flows · dataFlowsCreate

Create a draft data flow

Create a flow for an external agent to build.

POST/v1/data-flows
betaapiKeyworkspace

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

typescript
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

json
{
  "name": "Revenue flow",
  "description": "Revenue by customer",
  "dataSourceIds": [
    "data_abc123"
  ]
}

Response

json
{
  "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": []
  }
}