Skip to content
SoulFire LogoSoulFire

Create script

POST
/v1/instances/{instance_id}/scripts

Creates a new script in the specified instance. The script can be created with initial nodes and edges, or as a blank script to be edited later.

Authorization

headerAuthorizationBearer <JWT>

Preferred API authentication. Use a JWT with the api audience.

Path Parameters

instance_id*string

The instance to create the script in. Format: UUID string.

Formatuuid

Request Body

application/json
  1. body

Request to create a new script.

name*string

The human-readable name for the script.

description?string

Optional description of what the script does.

nodes*array<>

Initial nodes for the script graph. Can be empty to create a blank script.

edges*array<>

Initial edges for the script graph. Can be empty to create a blank script.

paused*boolean

Whether the script should be created in paused state. If false (default), the script starts running immediately after creation.

quotas?

Optional resource quotas for this script.

Response Body

Response after successfully creating a script.

application/json
  1. response

Response after successfully creating a script.

script*

The complete script data including the generated ID.

diagnostics*array<>

Validation diagnostics (warnings) from building the script graph.

Example Request
curl -X POST 'http://127.0.0.1:38765/v1/instances/497f6eca-6276-4993-bfeb-53cbbbba6f08/scripts' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "string",
  "nodes": [
    {
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "type": "string",
      "position": {
        "x": 0.1,
        "y": 0.1
      },
      "muted": true,
      "collapsed": true,
      "parentFrameId": "string"
    }
  ],
  "edges": [
    {
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "source": "string",
      "sourceHandle": "string",
      "target": "string",
      "targetHandle": "string",
      "edgeType": "EDGE_TYPE_EXECUTION"
    }
  ],
  "paused": true
}'
Example Response
{
  "script": {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "name": "string",
    "description": "string",
    "nodes": [
      {
        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
        "type": "string",
        "position": {
          "x": 0.1,
          "y": 0.1
        },
        "data": {
          "property1": null,
          "property2": null
        },
        "muted": true,
        "collapsed": true,
        "width": 0.1,
        "height": 0.1,
        "containedNodes": [
          "string"
        ],
        "label": "string",
        "resolvedType": "PORT_TYPE_ANY",
        "parentFrameId": "string"
      }
    ],
    "edges": [
      {
        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
        "source": "string",
        "sourceHandle": "string",
        "target": "string",
        "targetHandle": "string",
        "edgeType": "EDGE_TYPE_EXECUTION",
        "order": 0
      }
    ],
    "instanceId": "64d2028c-ae87-4069-a624-66089d957ef9",
    "paused": true,
    "quotas": {
      "maxExecutionCount": "string",
      "maxExecutionTimeMs": "string",
      "maxConcurrentTriggers": 0,
      "maxStateStoreEntries": "string",
      "disableTimeouts": true
    }
  },
  "diagnostics": [
    {
      "nodeId": "string",
      "edgeId": "string",
      "message": "string",
      "severity": "DIAGNOSTIC_ERROR"
    }
  ]
}

Was this page helpful?