Workflow Definitions
The /workflows/definitions
endpoints allows you to manage your Workflow Definitions. Workflow definitions are used to define the steps that will be executed by a workflow. They are written in a DSL that is based on JSON.
List Workflow Definitions
Endpoint: /workflows/definitions
Method: GET
Headers
Header | Value |
---|---|
Authorization | Bearer <YOUR_JWT_TOKEN> |
Example Request
There is no JSON body with this request.
Example Response
[
{
"id": "<WORKFLOW_DEFINITION_ID>",
"name": "Generate Renditions",
"description": "Generates renditions for a content object",
"tags": [
"renditions",
"images"
],
"created_at": "2023-04-20T12:00:00.000Z",
"updated_at": "2023-04-20T12:00:00.000Z"
}
]
Code Examples
List Workflow Definitions
curl --location --request GET 'https://studio-server-production.api.vertesia.io/api/v1/workflows/definitions' \
--header 'Authorization: Bearer <YOUR_JWT_TOKEN>'
Create a Workflow Definition
Endpoint: /workflows/definitions
Method: POST
Headers
Header | Value |
---|---|
Authorization | Bearer <YOUR_JWT_TOKEN> |
Input Parameters
Parameter | Data Type | Description |
---|---|---|
name | string | The name of the workflow definition. |
description | string | The description of the workflow definition. |
tags | string[] | The tags of the workflow definition. |
steps | DSLWorkflowStep[] | The steps of the workflow definition. |
vars | Record<string, any> | The variables of the workflow definition. |
options | DSLActivityOptions | The options of the workflow definition. |
result | string | The result of the workflow definition. |
debug_mode | boolean | The debug mode of the workflow definition. |
Example Request
{
"name": "Generate Renditions",
"description": "Generates renditions for a content object",
"tags": ["renditions", "images"],
"steps": [
{
"type": "activity",
"name": "generate_renditions",
"params": {
"objectId": "$.objectId",
"formats": ["jpg", "png"]
},
"output": "renditions"
},
{
"type": "activity",
"name": "wait",
"params": {
"duration": "10s"
}
},
{
"type": "activity",
"name": "update_object",
"params": {
"objectId": "$.objectId",
"properties": {
"renditions": "$.renditions"
}
}
}
],
"vars": {
"objectId": "<OBJECT_ID>"
}
}
Example Response
{
"id": "<WORKFLOW_DEFINITION_ID>",
"name": "Generate Renditions",
"description": "Generates renditions for a content object",
"tags": [
"renditions",
"images"
],
"created_at": "2023-04-20T12:00:00.000Z",
"updated_at": "2023-04-20T12:00:00.000Z"
}
Code Examples
Create a Workflow Definition
curl --location --request POST 'https://studio-server-production.api.vertesia.io/api/v1/workflows/definitions' \
--header 'Authorization: Bearer <YOUR_JWT_TOKEN>' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "Generate Renditions",
"description": "Generates renditions for a content object",
"tags": ["renditions", "images"],
"steps": [
{
"type": "activity",
"name": "generate_renditions",
"params": {
"objectId": "$.objectId",
"formats": ["jpg", "png"]
},
"output": "renditions"
},
{
"type": "activity",
"name": "wait",
"params": {
"duration": "10s"
}
},
{
"type": "activity",
"name": "update_object",
"params": {
"objectId": "$.objectId",
"properties": {
"renditions": "$.renditions"
}
}
}
],
"vars": {
"objectId": "<OBJECT_ID>"
}
}'
Retrieve a Workflow Definition
Endpoint: /workflows/definitions/<WORKFLOW_DEFINITION_ID>
Method: GET
Headers
Header | Value |
---|---|
Authorization | Bearer <YOUR_JWT_TOKEN> |
Path Parameters
Parameter | Description |
---|---|
<WORKFLOW_DEFINITION_ID> | The ID of the workflow definition to retrieve. |
Example Request
There is no JSON body with this request.
Example Response
{
"id": "<WORKFLOW_DEFINITION_ID>",
"name": "Generate Renditions",
"description": "Generates renditions for a content object",
"tags": [
"renditions",
"images"
],
"created_at": "2023-04-20T12:00:00.000Z",
"updated_at": "2023-04-20T12:00:00.000Z"
}
Code Examples
Retrieve a Workflow Definition
curl --location --request GET 'https://studio-server-production.api.vertesia.io/api/v1/workflows/definitions/<WORKFLOW_DEFINITION_ID>' \
--header 'Authorization: Bearer <YOUR_JWT_TOKEN>'
Update a Workflow Definition
Endpoint: /workflows/definitions/<WORKFLOW_DEFINITION_ID>
Method: PUT
Headers
Header | Value |
---|---|
Authorization | Bearer <YOUR_JWT_TOKEN> |
Path Parameters
Parameter | Description |
---|---|
<WORKFLOW_DEFINITION_ID> | The ID of the workflow definition to update. |
Input Parameters
Parameter | Data Type | Description |
---|---|---|
name | string | The name of the workflow definition. |
description | string | The description of the workflow definition. |
tags | string[] | The tags of the workflow definition. |
steps | DSLWorkflowStep[] | The steps of the workflow definition. |
vars | Record<string, any> | The variables of the workflow definition. |
options | DSLActivityOptions | The options of the workflow definition. |
result | string | The result of the workflow definition. |
debug_mode | boolean | The debug mode of the workflow definition. |
Example Request
{
"name": "Generate Renditions (updated)",
"description": "Generates renditions for a content object",
"tags": ["renditions", "images"],
"steps": [
{
"type": "activity",
"name": "generate_renditions",
"params": {
"objectId": "$.objectId",
"formats": ["jpg", "png", "webp"]
},
"output": "renditions"
},
{
"type": "activity",
"name": "wait",
"params": {
"duration": "10s"
}
},
{
"type": "activity",
"name": "update_object",
"params": {
"objectId": "$.objectId",
"properties": {
"renditions": "$.renditions"
}
}
}
],
"vars": {
"objectId": "<OBJECT_ID>"
}
}
Example Response
{
"id": "<WORKFLOW_DEFINITION_ID>",
"name": "Generate Renditions (updated)",
"description": "Generates renditions for a content object",
"tags": [
"renditions",
"images"
],
"created_at": "2023-04-20T12:00:00.000Z",
"updated_at": "2023-04-20T12:00:01.000Z"
}
Code Examples
Update a Workflow Definition
curl --location --request PUT 'https://studio-server-production.api.vertesia.io/api/v1/workflows/definitions/<WORKFLOW_DEFINITION_ID>' \
--header 'Authorization: Bearer <YOUR_JWT_TOKEN>' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "Generate Renditions (updated)",
"description": "Generates renditions for a content object",
"tags": ["renditions", "images"],
"steps": [
{
"type": "activity",
"name": "generate_renditions",
"params": {
"objectId": "$.objectId",
"formats": ["jpg", "png", "webp"]
},
"output": "renditions"
},
{
"type": "activity",
"name": "wait",
"params": {
"duration": "10s"
}
},
{
"type": "activity",
"name": "update_object",
"params": {
"objectId": "$.objectId",
"properties": {
"renditions": "$.renditions"
}
}
}
],
"vars": {
"objectId": "<OBJECT_ID>"
}
}'
Delete a Workflow Definition
Endpoint: /workflows/definitions/<WORKFLOW_DEFINITION_ID>
Method: DELETE
Headers
Header | Value |
---|---|
Authorization | Bearer <YOUR_JWT_TOKEN> |
Path Parameters
Parameter | Description |
---|---|
<WORKFLOW_DEFINITION_ID> | The ID of the workflow definition to delete. |
Example Request
There is no JSON body with this request.
Example Response
{
"id": "<WORKFLOW_DEFINITION_ID>"
}
Code Examples
Delete a Workflow Definition
curl --location --request DELETE 'https://studio-server-production.api.vertesia.io/api/v1/workflows/definitions/<WORKFLOW_DEFINITION_ID>' \
--header 'Authorization: Bearer <YOUR_JWT_TOKEN>'