POST
/
workflows
/
code
curl --location 'https://api.mixpeek.com/workflows/code' \
--header 'Authorization: Bearer sk-OldCtNxFD2Yu744JPWPCUut5h6XihVM7UzZN271R-3kmeJk7NDsRNkG2Ae1K01YK2dI' \
--header 'Content-Type: application/json' \
--data '{
    "code": "def hello_world():\\n    print('Hello, world!')\\nhello_world()",
    "settings": {
        "runtime_version": "python3.8"
    }
}'
{
  "code_as_string": "<string>",
  "execution_status": "<string>"
}

Request

code
string
required

The Python code to be executed as part of the workflow. The code should be designed to perform specific data processing tasks, leveraging Mixpeek API and other accessible resources as necessary. This field accepts the code as a string, enabling direct execution on the platform.

settings
object

Additional settings or parameters to configure the execution environment or provide context to the code being run. These can include environmental variables, execution flags, or any other relevant configurations that affect how the code is executed.

Response

code_as_string
string
required

A string representation of the executed code. This response confirms the exact code that was run, aiding in verification and debugging processes.

execution_status
string
required

Indicates the success or failure of the code execution, providing immediate feedback on the operation’s outcome.