PermuteDocs
Go to Permute

Data Flows · dataFlowsCommand

Edit or publish a data flow

Uses the same revision-checked graph commands as the editor. Includes adding, editing, connecting, and deleting nodes, updating or deleting the flow, and publishing a successful run. Fetch the flow after each command.

POST/v1/data-flows/{dataFlowId}/commands
betaapiKeyworkspace

When to use

Add or edit operations, wire inputs, publish, or delete a flow.

For agents

Uses the editor’s commands and permissions. Fetch the flow after each command. Publishing requires a successful current run; deleting a flow requires admin access and removes its owned operations.

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.command('oper_flow123', {
  "command": {
    "type": "addTransform",
    "expectedRevision": 2,
    "input": {
      "name": "Revenue by customer",
      "instruction": "Sum revenue by customer.",
      "inputIds": [
        "data_abc123"
      ]
    }
  }
});

Request body

json
{
  "command": {
    "type": "addTransform",
    "expectedRevision": 2,
    "input": {
      "name": "Revenue by customer",
      "instruction": "Sum revenue by customer.",
      "inputIds": [
        "data_abc123"
      ]
    }
  }
}

Response

json
{
  "data": {
    "dataFlowId": "oper_flow123",
    "deleted": false
  }
}