POST
/
workflows
/
curl --location 'https://api.mixpeek.com/workflows/' \
--header 'Authorization: Bearer API_KEY' \
--header 'Content-Type: application/json' \
--data '{
    "workflow_id": "unique_workflow_id",
    "code_as_string": "import json\\ndef process_data(data):\\n    return json.dumps({'processed': True, 'data': data})",
    "settings": {
        "runtime_version": "python3.8"
    },
    "workflow_name": "Data Processing Workflow",
    "metadata": {
        "description": "This workflow processes data and returns it in JSON format."
    }
}'
{
  "workflow_id": "<string>",
  "workflow_name": "<string>",
  "metadata": {}
}

Request

workflow_id
string

An optional identifier for the workflow. If provided, it specifies a unique ID to reference the workflow, facilitating easier management and invocation of the workflow in the future.

code_as_string
string
required

The code that defines the workflow’s logic and operations. This code is executed as part of the workflow, enabling custom data processing tasks. The code should be provided as a string.

settings
object
required

Configuration settings for the workflow’s execution environment. This can include the runtime version, environmental variables, and other relevant settings that tailor the execution context to the workflow’s requirements.

workflow_name
string

An optional name for the workflow. Providing a name can help with identifying and organizing workflows, especially when dealing with multiple workflows.

metadata
object

Optional metadata to provide additional context or information about the workflow. This could include descriptions, tags, or any other relevant information that helps describe the workflow’s purpose or usage.

Response

workflow_id
string
required

The unique identifier for the newly created workflow. This ID can be used to reference the workflow in future operations, such as updates, invocations, or deletions.

workflow_name
string

The name of the workflow, as provided in the request or generated by the system. This helps in identifying the workflow among multiple workflows.

metadata
object

Echoes back any metadata provided in the request, confirming the additional contextual information associated with the workflow.