Python
from engini import Engini
client = Engini() # reads ENGINI_API_KEY
# needs a workspace-scoped key
wf = client.workflows.set_enabled(1234, True)import { Engini } from "@engini/sdk";
const client = new Engini(); // reads ENGINI_API_KEY
// needs a workspace-scoped key
const wf = await client.workflows.setEnabled(1234, true);engini workflows enable 1234
engini workflows disable 1234const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({enabled: true})
};
fetch('https://api.engini.io/v1/workflows/{workflowId}/enabled', 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}/enabled",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'enabled' => true
]),
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}/enabled"
payload := strings.NewReader("{\n \"enabled\": true\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.engini.io/v1/workflows/{workflowId}/enabled")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"enabled\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.engini.io/v1/workflows/{workflowId}/enabled")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"enabled\": true\n}"
response = http.request(request)
puts response.read_body{
"workflowId": 123,
"name": "<string>",
"type": "<string>",
"enabled": true,
"deleted": true,
"blocked": true,
"consecutiveFailures": 123,
"maxConsecutiveFailures": 123,
"createdAt": "2023-11-07T05:31:56Z",
"createdBy": {
"id": 123,
"name": "<string>"
},
"historyRetentionDays": 123,
"workflowConcurrency": 123,
"applyConcurrencyLimitOnWaitingWorkflow": true,
"stepsCount": 123,
"connections": [
{
"connectionId": 123,
"connectionName": "<string>",
"applicationName": "<string>",
"applicationSlug": "<string>"
}
],
"workspace": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"environment": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"type": "<string>"
},
"slug": "<string>",
"folderName": "<string>",
"folderId": 123,
"deletedAt": "2023-11-07T05:31:56Z",
"deletedBy": {
"id": 123,
"name": "<string>"
},
"blockReason": "<string>",
"blockedDate": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"updatedBy": {
"id": 123,
"name": "<string>"
},
"lastRunAt": "2023-11-07T05:31:56Z",
"nextRun": "2023-11-07T05:31:56Z",
"description": "<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>"
}
]
}Workflows
Turn a workflow on or off
Enables or disables a workflow. A body that omits enabled is rejected rather than accidentally disabling the workflow.
When the state changes, this call moves the workflow’s updatedAt and records a revision, exactly as toggling it in the product does. Repeating the current state returns the workflow unchanged. Disabling a workflow that backs a published tool also withdraws that tool from the tool list.
PUT
/
v1
/
workflows
/
{workflowId}
/
enabled
Python
from engini import Engini
client = Engini() # reads ENGINI_API_KEY
# needs a workspace-scoped key
wf = client.workflows.set_enabled(1234, True)import { Engini } from "@engini/sdk";
const client = new Engini(); // reads ENGINI_API_KEY
// needs a workspace-scoped key
const wf = await client.workflows.setEnabled(1234, true);engini workflows enable 1234
engini workflows disable 1234const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({enabled: true})
};
fetch('https://api.engini.io/v1/workflows/{workflowId}/enabled', 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}/enabled",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'enabled' => true
]),
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}/enabled"
payload := strings.NewReader("{\n \"enabled\": true\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.engini.io/v1/workflows/{workflowId}/enabled")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"enabled\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.engini.io/v1/workflows/{workflowId}/enabled")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"enabled\": true\n}"
response = http.request(request)
puts response.read_body{
"workflowId": 123,
"name": "<string>",
"type": "<string>",
"enabled": true,
"deleted": true,
"blocked": true,
"consecutiveFailures": 123,
"maxConsecutiveFailures": 123,
"createdAt": "2023-11-07T05:31:56Z",
"createdBy": {
"id": 123,
"name": "<string>"
},
"historyRetentionDays": 123,
"workflowConcurrency": 123,
"applyConcurrencyLimitOnWaitingWorkflow": true,
"stepsCount": 123,
"connections": [
{
"connectionId": 123,
"connectionName": "<string>",
"applicationName": "<string>",
"applicationSlug": "<string>"
}
],
"workspace": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
},
"environment": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"type": "<string>"
},
"slug": "<string>",
"folderName": "<string>",
"folderId": 123,
"deletedAt": "2023-11-07T05:31:56Z",
"deletedBy": {
"id": 123,
"name": "<string>"
},
"blockReason": "<string>",
"blockedDate": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"updatedBy": {
"id": 123,
"name": "<string>"
},
"lastRunAt": "2023-11-07T05:31:56Z",
"nextRun": "2023-11-07T05:31:56Z",
"description": "<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>"
}
]
}Body
application/json
The enabled state to set.
Response
The workflow as it stands after the change.
Public shape of a workflow, as returned by GET /v1/workflows.