Skip to main content
Create workflow
import requests

url = 'https://api.simplex.sh/workflow'
headers = {
    'X-API-Key': 'your_api_key_here',
    'Content-Type': 'application/json'
}

data = {
    'name': 'My New Workflow',
    'url': 'https://example.com',
    'metadata': 'production, automated',
    'actions': [
        {
            'function': 'navigate',
            'params': {'url': 'https://example.com/login'}
        },
        {
            'function': 'type',
            'params': {'text': '{{username}}'}
        },
        {
            'function': 'click',
            'params': {'element_description': 'submit button'}
        }
    ],
    'variables': {
        'username': {
            'type': 'string',
            'required': True
        }
    }
}

response = requests.post(url, headers=headers, json=data)
result = response.json()
if result['succeeded']:
    print(f"Created workflow with ID: {result['workflow']['id']}")
{
  "succeeded": true,
  "message": "<string>",
  "workflow": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "name": "<string>",
    "actions": [
      {}
    ],
    "variables": {},
    "url": "<string>",
    "metadata": "<string>"
  }
}
Create a new workflow. The only required field is the workflow name. You can optionally provide actions, variables, URL, and metadata to configure the workflow.

Body

application/json
name
string
required

The workflow name

actions
object[]

Array of actions in the workflow

variables
object

Variables used in the workflow

url
string | null

Starting URL for the workflow

metadata
string | null

Additional metadata about the workflow

Response

Workflow created successfully

succeeded
boolean
required

Whether the request succeeded

message
string
required

Success message

workflow
object
required