Workflows¶
List workflows, send a work item to a workflow, release a hold, and read and set global variables, including secret variables.
Every call in this group
- Method
POSTtohttps://{tenant}/api/{Group}/{Action}, also for reads. - Header
TempIdentityToken: <token>. Create tokens in Configuration > Services > API Access. - Success HTTP 200 with
{ "Success": true, "MessageKey": ..., "Data": ... }. Always checkSuccess. - Failure HTTP 412 with
{ "Success": false, "Messages": [ { "MessageKey": ... } ] }. The spec lists failures as 400; the server sends 412. HTTP 401 means the token or its features; HTTP 422 means the body does not match the model. - C# samples Use the generated client
KL.APIClient. Generate the client from your tenant's spec (how). A non-200 status throwsKL.APIClient.Client.ApiException. - Guides API introduction, Authentication
Actions¶
| Action | Summary |
|---|---|
| GetAllWorkflows | |
| GetGlobalVariable | Get a detailed result object representing the contents of the global variable and its metadata. Cannot be used for secret variables. |
| GetGlobalVariableMetadata | Get a detailed result object representing the metadata of the global variable. |
| GetWorkflow | |
| ReleaseHold | |
| SendToWorkflow | |
| SetGlobalVariable | Used to create or modify non-secret global variables. |
| SetSecretGlobalVariable | Used to create or modify secret global variables. This endpoint requires permissions manage workflows and manage secret global variables |
GetAllWorkflows¶
- Token feature Manage Workflows
- Content type application/json
Request¶
No body. Send {} or an empty body.
Response¶
All Workflows Info.
Envelope: KLApiDataResponseListWorkflowDTO. Data is array of WorkflowDTO.
{
"Success": true,
"MessageKey": null,
"Data": [
{
"WorkflowId": "00000000-0000-0000-0000-000000000000",
"WorkflowName": null,
"FirstStepId": "00000000-0000-0000-0000-000000000000",
"Version": "0"
}
]
}
Example¶
using KL.APIClient.Api;
using KL.APIClient.Client;
using KL.APIClient.Model;
var config = new Configuration { BasePath = "https://yourcompany.knowledgelake.io/api" };
config.AddApiKey("TempIdentityToken", Environment.GetEnvironmentVariable("KL_TOKEN"));
var api = new V1WorkflowAPIApi(config);
var response = await api.V1WorkflowAPIControllerGetAllWorkflowsAsync();
if (response.Success != true) throw new Exception(response.MessageKey);
Console.WriteLine(response.Data);
import os, requests
r = requests.post("https://yourcompany.knowledgelake.io/api/V1_WorkflowAPI/GetAllWorkflows",
headers={"TempIdentityToken": os.environ["KL_TOKEN"]},
json={})
data = r.json()
if not data.get("Success"):
raise RuntimeError(data.get("MessageKey") or data.get("Messages"))
print(data["Data"])
const r = await fetch("https://yourcompany.knowledgelake.io/api/V1_WorkflowAPI/GetAllWorkflows", {
method: "POST",
headers: { "TempIdentityToken": process.env.KL_TOKEN, "Content-Type": "application/json" },
body: JSON.stringify({})
});
const data = await r.json();
if (!data.Success) throw new Error(data.MessageKey ?? JSON.stringify(data.Messages));
console.log(data.Data);
GetGlobalVariable¶
Get a detailed result object representing the contents of the global variable and its metadata. Cannot be used for secret variables.
- Token feature Manage Workflows
- Content type application/json
Request¶
Request object to get a Global Variable in Workflow..
Schema: GetWorkerGlobalVariableParameter. Request object to get a Global Variable in Workflow.
| Field | Type | Description |
|---|---|---|
Name |
string | Name of the variable. |
Response¶
The returned Global Variable.
Envelope: KLApiDataResponseVersionedWorkerGlobalVariable. Data is VersionedWorkerGlobalVariable.
{
"Success": true,
"MessageKey": null,
"Data": {
"Modified": "0001-01-01T00:00:00.0000000+00:00",
"Version": "0",
"Enabled": false,
"DisabledAtTime": "0001-01-01T00:00:00.0000000+00:00",
"Value": null,
"Name": null,
"IsSecret": false,
"LastModifier": null,
"Tags": null,
"Group": null,
"GroupDisplayName": null,
"Type": null,
"TypeDisplayName": null
}
}
Example¶
using KL.APIClient.Api;
using KL.APIClient.Client;
using KL.APIClient.Model;
var config = new Configuration { BasePath = "https://yourcompany.knowledgelake.io/api" };
config.AddApiKey("TempIdentityToken", Environment.GetEnvironmentVariable("KL_TOKEN"));
var api = new V1WorkflowAPIApi(config);
var response = await api.V1WorkflowAPIControllerGetGlobalVariableAsync(new GetWorkerGlobalVariableParameter
{
Name = "string",
});
if (response.Success != true) throw new Exception(response.MessageKey);
Console.WriteLine(response.Data);
$body = @'
{
"Name": "string"
}
'@
$r = Invoke-RestMethod -Method Post -Uri "https://yourcompany.knowledgelake.io/api/V1_WorkflowAPI/GetGlobalVariable" `
-Headers @{ TempIdentityToken = $env:KL_TOKEN } `
-ContentType "application/json" -Body $body
if (-not $r.Success) { throw $r.MessageKey }
$r.Data
import os, requests
r = requests.post("https://yourcompany.knowledgelake.io/api/V1_WorkflowAPI/GetGlobalVariable",
headers={"TempIdentityToken": os.environ["KL_TOKEN"]},
json={
"Name": "string"
})
data = r.json()
if not data.get("Success"):
raise RuntimeError(data.get("MessageKey") or data.get("Messages"))
print(data["Data"])
const r = await fetch("https://yourcompany.knowledgelake.io/api/V1_WorkflowAPI/GetGlobalVariable", {
method: "POST",
headers: { "TempIdentityToken": process.env.KL_TOKEN, "Content-Type": "application/json" },
body: JSON.stringify({
"Name": "string"
})
});
const data = await r.json();
if (!data.Success) throw new Error(data.MessageKey ?? JSON.stringify(data.Messages));
console.log(data.Data);
GetGlobalVariableMetadata¶
Get a detailed result object representing the metadata of the global variable.
- Token feature Manage Workflows
- Content type application/json
Request¶
Request object to get a Global Variable in Workflow..
Schema: GetWorkerGlobalVariableParameter. Request object to get a Global Variable in Workflow.
| Field | Type | Description |
|---|---|---|
Name |
string | Name of the variable. |
Response¶
The returned Global Variable's metadata.
Envelope: KLApiDataResponseGlobalVariableMetadataDTO. Data is GlobalVariableMetadataDTO.
{
"Success": true,
"MessageKey": null,
"Data": {
"Name": null,
"Tags": null,
"Type": null,
"IsSecret": false
}
}
Example¶
using KL.APIClient.Api;
using KL.APIClient.Client;
using KL.APIClient.Model;
var config = new Configuration { BasePath = "https://yourcompany.knowledgelake.io/api" };
config.AddApiKey("TempIdentityToken", Environment.GetEnvironmentVariable("KL_TOKEN"));
var api = new V1WorkflowAPIApi(config);
var response = await api.V1WorkflowAPIControllerGetGlobalVariableMetadataAsync(new GetWorkerGlobalVariableParameter
{
Name = "string",
});
if (response.Success != true) throw new Exception(response.MessageKey);
Console.WriteLine(response.Data);
$body = @'
{
"Name": "string"
}
'@
$r = Invoke-RestMethod -Method Post -Uri "https://yourcompany.knowledgelake.io/api/V1_WorkflowAPI/GetGlobalVariableMetadata" `
-Headers @{ TempIdentityToken = $env:KL_TOKEN } `
-ContentType "application/json" -Body $body
if (-not $r.Success) { throw $r.MessageKey }
$r.Data
import os, requests
r = requests.post("https://yourcompany.knowledgelake.io/api/V1_WorkflowAPI/GetGlobalVariableMetadata",
headers={"TempIdentityToken": os.environ["KL_TOKEN"]},
json={
"Name": "string"
})
data = r.json()
if not data.get("Success"):
raise RuntimeError(data.get("MessageKey") or data.get("Messages"))
print(data["Data"])
const r = await fetch("https://yourcompany.knowledgelake.io/api/V1_WorkflowAPI/GetGlobalVariableMetadata", {
method: "POST",
headers: { "TempIdentityToken": process.env.KL_TOKEN, "Content-Type": "application/json" },
body: JSON.stringify({
"Name": "string"
})
});
const data = await r.json();
if (!data.Success) throw new Error(data.MessageKey ?? JSON.stringify(data.Messages));
console.log(data.Data);
GetWorkflow¶
- Token feature Manage Workflows
- Content type application/json
Request¶
Request object to retrieve a Workflow..
Schema: GetWorkflowParameter. Request object to retrieve a Workflow.
| Field | Type | Description |
|---|---|---|
WorkflowId |
string (uuid) | Id of the Workflow. |
WorkflowName |
string | Name of the Workflow. |
WorkflowVersion |
integer | Version of this Workflow to get. Null means use latest. |
Response¶
Workflow Info.
Envelope: KLApiDataResponseWorkflowDTO. Data is WorkflowDTO.
{
"Success": true,
"MessageKey": null,
"Data": {
"WorkflowId": "00000000-0000-0000-0000-000000000000",
"WorkflowName": null,
"FirstStepId": "00000000-0000-0000-0000-000000000000",
"Version": "0"
}
}
Example¶
using KL.APIClient.Api;
using KL.APIClient.Client;
using KL.APIClient.Model;
var config = new Configuration { BasePath = "https://yourcompany.knowledgelake.io/api" };
config.AddApiKey("TempIdentityToken", Environment.GetEnvironmentVariable("KL_TOKEN"));
var api = new V1WorkflowAPIApi(config);
var response = await api.V1WorkflowAPIControllerGetWorkflowAsync(new GetWorkflowParameter
{
WorkflowId = Guid.Parse("00000000-0000-0000-0000-000000000000"),
WorkflowName = "string",
WorkflowVersion = 0,
});
if (response.Success != true) throw new Exception(response.MessageKey);
Console.WriteLine(response.Data);
$body = @'
{
"WorkflowId": "00000000-0000-0000-0000-000000000000",
"WorkflowName": "string",
"WorkflowVersion": 0
}
'@
$r = Invoke-RestMethod -Method Post -Uri "https://yourcompany.knowledgelake.io/api/V1_WorkflowAPI/GetWorkflow" `
-Headers @{ TempIdentityToken = $env:KL_TOKEN } `
-ContentType "application/json" -Body $body
if (-not $r.Success) { throw $r.MessageKey }
$r.Data
import os, requests
r = requests.post("https://yourcompany.knowledgelake.io/api/V1_WorkflowAPI/GetWorkflow",
headers={"TempIdentityToken": os.environ["KL_TOKEN"]},
json={
"WorkflowId": "00000000-0000-0000-0000-000000000000",
"WorkflowName": "string",
"WorkflowVersion": 0
})
data = r.json()
if not data.get("Success"):
raise RuntimeError(data.get("MessageKey") or data.get("Messages"))
print(data["Data"])
const r = await fetch("https://yourcompany.knowledgelake.io/api/V1_WorkflowAPI/GetWorkflow", {
method: "POST",
headers: { "TempIdentityToken": process.env.KL_TOKEN, "Content-Type": "application/json" },
body: JSON.stringify({
"WorkflowId": "00000000-0000-0000-0000-000000000000",
"WorkflowName": "string",
"WorkflowVersion": 0
})
});
const data = await r.json();
if (!data.Success) throw new Error(data.MessageKey ?? JSON.stringify(data.Messages));
console.log(data.Data);
ReleaseHold¶
- Token feature Manage Workflows
- Content type application/json
Request¶
Work Item ID.
Schema: PaasWorkItemIdDTO
| Field | Type | Description |
|---|---|---|
WorkItemId |
string (uuid) |
Response¶
Work Item Info.
Envelope: KLApiDataResponsePaasWorkItemIdDTO. Data is PaasWorkItemIdDTO.
{
"Success": true,
"MessageKey": null,
"Data": {
"WorkItemId": "00000000-0000-0000-0000-000000000000"
}
}
Example¶
using KL.APIClient.Api;
using KL.APIClient.Client;
using KL.APIClient.Model;
var config = new Configuration { BasePath = "https://yourcompany.knowledgelake.io/api" };
config.AddApiKey("TempIdentityToken", Environment.GetEnvironmentVariable("KL_TOKEN"));
var api = new V1WorkflowAPIApi(config);
var response = await api.V1WorkflowAPIControllerReleaseHoldAsync(new PaasWorkItemIdDTO
{
WorkItemId = Guid.Parse("00000000-0000-0000-0000-000000000000"),
});
if (response.Success != true) throw new Exception(response.MessageKey);
Console.WriteLine(response.Data);
$body = @'
{
"WorkItemId": "00000000-0000-0000-0000-000000000000"
}
'@
$r = Invoke-RestMethod -Method Post -Uri "https://yourcompany.knowledgelake.io/api/V1_WorkflowAPI/ReleaseHold" `
-Headers @{ TempIdentityToken = $env:KL_TOKEN } `
-ContentType "application/json" -Body $body
if (-not $r.Success) { throw $r.MessageKey }
$r.Data
import os, requests
r = requests.post("https://yourcompany.knowledgelake.io/api/V1_WorkflowAPI/ReleaseHold",
headers={"TempIdentityToken": os.environ["KL_TOKEN"]},
json={
"WorkItemId": "00000000-0000-0000-0000-000000000000"
})
data = r.json()
if not data.get("Success"):
raise RuntimeError(data.get("MessageKey") or data.get("Messages"))
print(data["Data"])
const r = await fetch("https://yourcompany.knowledgelake.io/api/V1_WorkflowAPI/ReleaseHold", {
method: "POST",
headers: { "TempIdentityToken": process.env.KL_TOKEN, "Content-Type": "application/json" },
body: JSON.stringify({
"WorkItemId": "00000000-0000-0000-0000-000000000000"
})
});
const data = await r.json();
if (!data.Success) throw new Error(data.MessageKey ?? JSON.stringify(data.Messages));
console.log(data.Data);
SendToWorkflow¶
- Token feature Manage Workflows
- Content type application/json
Request¶
Request object to run a Workflow..
Schema: RunWorkflowParameter. Request object to run a Workflow.
| Field | Type | Description |
|---|---|---|
WorkflowId |
string (uuid) | Id of the Workflow. |
WorkItemId |
string (uuid) | Id of the Work Item to send to this Workflow. |
WorkflowVersion |
integer | Version of this Workflow to use. Null means use latest. |
WorkflowStep |
string (uuid) | Optional Id of the step to start the workflow from. |
Response¶
Work Item Info.
Envelope: KLApiDataResponsePaasWorkItemIdDTO. Data is PaasWorkItemIdDTO.
{
"Success": true,
"MessageKey": null,
"Data": {
"WorkItemId": "00000000-0000-0000-0000-000000000000"
}
}
Example¶
using KL.APIClient.Api;
using KL.APIClient.Client;
using KL.APIClient.Model;
var config = new Configuration { BasePath = "https://yourcompany.knowledgelake.io/api" };
config.AddApiKey("TempIdentityToken", Environment.GetEnvironmentVariable("KL_TOKEN"));
var api = new V1WorkflowAPIApi(config);
var response = await api.V1WorkflowAPIControllerSendToWorkflowAsync(new RunWorkflowParameter
{
WorkflowId = Guid.Parse("00000000-0000-0000-0000-000000000000"),
WorkItemId = Guid.Parse("00000000-0000-0000-0000-000000000000"),
WorkflowVersion = 0,
WorkflowStep = Guid.Parse("00000000-0000-0000-0000-000000000000"),
});
if (response.Success != true) throw new Exception(response.MessageKey);
Console.WriteLine(response.Data);
curl -sS -X POST "https://yourcompany.knowledgelake.io/api/V1_WorkflowAPI/SendToWorkflow" \
-H "TempIdentityToken: $KL_TOKEN" \
-H "Content-Type: application/json" \
-d '{"WorkflowId": "00000000-0000-0000-0000-000000000000", "WorkItemId": "00000000-0000-0000-0000-000000000000", "WorkflowVersion": 0, "WorkflowStep": "00000000-0000-0000-0000-000000000000"}'
$body = @'
{
"WorkflowId": "00000000-0000-0000-0000-000000000000",
"WorkItemId": "00000000-0000-0000-0000-000000000000",
"WorkflowVersion": 0,
"WorkflowStep": "00000000-0000-0000-0000-000000000000"
}
'@
$r = Invoke-RestMethod -Method Post -Uri "https://yourcompany.knowledgelake.io/api/V1_WorkflowAPI/SendToWorkflow" `
-Headers @{ TempIdentityToken = $env:KL_TOKEN } `
-ContentType "application/json" -Body $body
if (-not $r.Success) { throw $r.MessageKey }
$r.Data
import os, requests
r = requests.post("https://yourcompany.knowledgelake.io/api/V1_WorkflowAPI/SendToWorkflow",
headers={"TempIdentityToken": os.environ["KL_TOKEN"]},
json={
"WorkflowId": "00000000-0000-0000-0000-000000000000",
"WorkItemId": "00000000-0000-0000-0000-000000000000",
"WorkflowVersion": 0,
"WorkflowStep": "00000000-0000-0000-0000-000000000000"
})
data = r.json()
if not data.get("Success"):
raise RuntimeError(data.get("MessageKey") or data.get("Messages"))
print(data["Data"])
const r = await fetch("https://yourcompany.knowledgelake.io/api/V1_WorkflowAPI/SendToWorkflow", {
method: "POST",
headers: { "TempIdentityToken": process.env.KL_TOKEN, "Content-Type": "application/json" },
body: JSON.stringify({
"WorkflowId": "00000000-0000-0000-0000-000000000000",
"WorkItemId": "00000000-0000-0000-0000-000000000000",
"WorkflowVersion": 0,
"WorkflowStep": "00000000-0000-0000-0000-000000000000"
})
});
const data = await r.json();
if (!data.Success) throw new Error(data.MessageKey ?? JSON.stringify(data.Messages));
console.log(data.Data);
SetGlobalVariable¶
Used to create or modify non-secret global variables.
- Token feature Manage Workflows
- Content type application/json
Request¶
Request object to upsert a Global Variable in Workflow..
Schema: WorkerGlobalVariableParameter. Request object to upsert a Global Variable in Workflow.
| Field | Type | Description |
|---|---|---|
Name |
string | Name of the variable. |
Value |
string | Value of the variable. |
Tags |
array of string | Tags of the variable. |
Type |
string | Type of the variable. |
SubType |
string | SubType of the variable. |
Response¶
The set Global Variable.
Envelope: KLApiDataResponseWorkerGlobalVariableParameter. Data is WorkerGlobalVariableParameter.
{
"Success": true,
"MessageKey": null,
"Data": {
"Name": null,
"Value": null,
"Tags": null,
"Type": null,
"SubType": null
}
}
Example¶
using KL.APIClient.Api;
using KL.APIClient.Client;
using KL.APIClient.Model;
var config = new Configuration { BasePath = "https://yourcompany.knowledgelake.io/api" };
config.AddApiKey("TempIdentityToken", Environment.GetEnvironmentVariable("KL_TOKEN"));
var api = new V1WorkflowAPIApi(config);
var response = await api.V1WorkflowAPIControllerSetGlobalVariableAsync(new WorkerGlobalVariableParameter
{
Name = "string",
Value = "string",
Tags = new List<string> { "string" },
Type = "string",
SubType = "string",
});
if (response.Success != true) throw new Exception(response.MessageKey);
Console.WriteLine(response.Data);
$body = @'
{
"Name": "string",
"Value": "string",
"Tags": [
"string"
],
"Type": "string",
"SubType": "string"
}
'@
$r = Invoke-RestMethod -Method Post -Uri "https://yourcompany.knowledgelake.io/api/V1_WorkflowAPI/SetGlobalVariable" `
-Headers @{ TempIdentityToken = $env:KL_TOKEN } `
-ContentType "application/json" -Body $body
if (-not $r.Success) { throw $r.MessageKey }
$r.Data
import os, requests
r = requests.post("https://yourcompany.knowledgelake.io/api/V1_WorkflowAPI/SetGlobalVariable",
headers={"TempIdentityToken": os.environ["KL_TOKEN"]},
json={
"Name": "string",
"Value": "string",
"Tags": [
"string"
],
"Type": "string",
"SubType": "string"
})
data = r.json()
if not data.get("Success"):
raise RuntimeError(data.get("MessageKey") or data.get("Messages"))
print(data["Data"])
const r = await fetch("https://yourcompany.knowledgelake.io/api/V1_WorkflowAPI/SetGlobalVariable", {
method: "POST",
headers: { "TempIdentityToken": process.env.KL_TOKEN, "Content-Type": "application/json" },
body: JSON.stringify({
"Name": "string",
"Value": "string",
"Tags": [
"string"
],
"Type": "string",
"SubType": "string"
})
});
const data = await r.json();
if (!data.Success) throw new Error(data.MessageKey ?? JSON.stringify(data.Messages));
console.log(data.Data);
SetSecretGlobalVariable¶
Used to create or modify secret global variables. This endpoint requires permissions manage workflows and manage secret global variables
- Token feature Manage Workflows and Manage Secret Global Variables
- Content type application/json
Request¶
Request object to upsert a Global Variable in Workflow..
Schema: WorkerGlobalVariableParameter. Request object to upsert a Global Variable in Workflow.
| Field | Type | Description |
|---|---|---|
Name |
string | Name of the variable. |
Value |
string | Value of the variable. |
Tags |
array of string | Tags of the variable. |
Type |
string | Type of the variable. |
SubType |
string | SubType of the variable. |
Response¶
The secret Global Variable was set.
Envelope: KLApiResponse.
Example¶
using KL.APIClient.Api;
using KL.APIClient.Client;
using KL.APIClient.Model;
var config = new Configuration { BasePath = "https://yourcompany.knowledgelake.io/api" };
config.AddApiKey("TempIdentityToken", Environment.GetEnvironmentVariable("KL_TOKEN"));
var api = new V1WorkflowAPIApi(config);
var response = await api.V1WorkflowAPIControllerSetSecretGlobalVariableAsync(new WorkerGlobalVariableParameter
{
Name = "string",
Value = "string",
Tags = new List<string> { "string" },
Type = "string",
SubType = "string",
});
if (response.Success != true) throw new Exception(response.MessageKey);
Console.WriteLine(response);
$body = @'
{
"Name": "string",
"Value": "string",
"Tags": [
"string"
],
"Type": "string",
"SubType": "string"
}
'@
$r = Invoke-RestMethod -Method Post -Uri "https://yourcompany.knowledgelake.io/api/V1_WorkflowAPI/SetSecretGlobalVariable" `
-Headers @{ TempIdentityToken = $env:KL_TOKEN } `
-ContentType "application/json" -Body $body
if (-not $r.Success) { throw $r.MessageKey }
$r.Data
import os, requests
r = requests.post("https://yourcompany.knowledgelake.io/api/V1_WorkflowAPI/SetSecretGlobalVariable",
headers={"TempIdentityToken": os.environ["KL_TOKEN"]},
json={
"Name": "string",
"Value": "string",
"Tags": [
"string"
],
"Type": "string",
"SubType": "string"
})
data = r.json()
if not data.get("Success"):
raise RuntimeError(data.get("MessageKey") or data.get("Messages"))
print(data["Data"])
const r = await fetch("https://yourcompany.knowledgelake.io/api/V1_WorkflowAPI/SetSecretGlobalVariable", {
method: "POST",
headers: { "TempIdentityToken": process.env.KL_TOKEN, "Content-Type": "application/json" },
body: JSON.stringify({
"Name": "string",
"Value": "string",
"Tags": [
"string"
],
"Type": "string",
"SubType": "string"
})
});
const data = await r.json();
if (!data.Success) throw new Error(data.MessageKey ?? JSON.stringify(data.Messages));
console.log(data.Data);