from engini import Engini
client = Engini() # reads ENGINI_API_KEY
# needs a workspace-scoped key; no idempotency key, so a retry starts a second run
run = client.workflows.run(1234, {"email": "a@b.co"})
print(run.execution_id, run.status)import { Engini } from "@engini/sdk";
const client = new Engini(); // reads ENGINI_API_KEY
// needs a workspace-scoped key; no idempotency key, so a retry starts a second run
const run = await client.workflows.run(1234, { email: "a@b.co" });
console.log(run.executionId, run.status);engini workflows run 1234 --body '{"email":"a@b.co"}'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://api.engini.io/v1/workflows/{workflowId}/run', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.engini.io/v1/workflows/{workflowId}/run",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.engini.io/v1/workflows/{workflowId}/run"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.engini.io/v1/workflows/{workflowId}/run")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.engini.io/v1/workflows/{workflowId}/run")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{}"
response = http.request(request)
puts response.read_body{
"executionId": 123,
"workflowId": 123,
"type": "<string>",
"triggerType": "<string>",
"status": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"activitiesRan": 123,
"dataTransferred": 123,
"dataAvailable": true,
"workspace": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"environment": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"type": "<string>"
},
"startedAt": "2023-11-07T05:31:56Z",
"closedAt": "2023-11-07T05:31:56Z",
"duration": 123,
"context": "<string>",
"createdBy": {
"id": 123,
"name": "<string>"
}
}{
"errorCode": "<string>",
"message": "<string>",
"requestId": "<string>",
"timestamp": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}{
"errorCode": "<string>",
"message": "<string>",
"requestId": "<string>",
"timestamp": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}{
"errorCode": "<string>",
"message": "<string>",
"requestId": "<string>",
"timestamp": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}{
"errorCode": "<string>",
"message": "<string>",
"requestId": "<string>",
"timestamp": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}{
"errorCode": "<string>",
"message": "<string>",
"requestId": "<string>",
"timestamp": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}{
"errorCode": "<string>",
"message": "<string>",
"requestId": "<string>",
"timestamp": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}{
"errorCode": "<string>",
"message": "<string>",
"requestId": "<string>",
"timestamp": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}Run a workflow
Starts a workflow immediately and returns the execution that was created. The request body is handed to the workflow’s trigger step.
Only workflows with an instant or scheduled trigger can be run this way. The record-triggered types expect event data about a specific record, so running one with an arbitrary body would execute but produce a run whose history means nothing.
For a workflow with no response step the run is asynchronous: the execution comes back in a non-terminal status and should be polled with the get-execution endpoint until it closes. A run that started and then failed is a 200 carrying an execution with status failure - the error statuses are reserved for runs that never started at all.
There is no idempotency key: retrying this call starts a second execution.
from engini import Engini
client = Engini() # reads ENGINI_API_KEY
# needs a workspace-scoped key; no idempotency key, so a retry starts a second run
run = client.workflows.run(1234, {"email": "a@b.co"})
print(run.execution_id, run.status)import { Engini } from "@engini/sdk";
const client = new Engini(); // reads ENGINI_API_KEY
// needs a workspace-scoped key; no idempotency key, so a retry starts a second run
const run = await client.workflows.run(1234, { email: "a@b.co" });
console.log(run.executionId, run.status);engini workflows run 1234 --body '{"email":"a@b.co"}'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://api.engini.io/v1/workflows/{workflowId}/run', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.engini.io/v1/workflows/{workflowId}/run",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.engini.io/v1/workflows/{workflowId}/run"
payload := strings.NewReader("{}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.engini.io/v1/workflows/{workflowId}/run")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.engini.io/v1/workflows/{workflowId}/run")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{}"
response = http.request(request)
puts response.read_body{
"executionId": 123,
"workflowId": 123,
"type": "<string>",
"triggerType": "<string>",
"status": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"activitiesRan": 123,
"dataTransferred": 123,
"dataAvailable": true,
"workspace": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"environment": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"type": "<string>"
},
"startedAt": "2023-11-07T05:31:56Z",
"closedAt": "2023-11-07T05:31:56Z",
"duration": 123,
"context": "<string>",
"createdBy": {
"id": 123,
"name": "<string>"
}
}{
"errorCode": "<string>",
"message": "<string>",
"requestId": "<string>",
"timestamp": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}{
"errorCode": "<string>",
"message": "<string>",
"requestId": "<string>",
"timestamp": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}{
"errorCode": "<string>",
"message": "<string>",
"requestId": "<string>",
"timestamp": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}{
"errorCode": "<string>",
"message": "<string>",
"requestId": "<string>",
"timestamp": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}{
"errorCode": "<string>",
"message": "<string>",
"requestId": "<string>",
"timestamp": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}{
"errorCode": "<string>",
"message": "<string>",
"requestId": "<string>",
"timestamp": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}{
"errorCode": "<string>",
"message": "<string>",
"requestId": "<string>",
"timestamp": "<string>",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}Response
The execution that was started.
Public shape of one workflow, table-automation or app-business-rule execution.
Whether the execution's per-step log and payloads are still available. Executions past their workflow's retention window keep their summary row but have their per-step detail purged; those rows stay in the list with this set to false, so a wide query never shows silent gaps.