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

HeaderValue
AuthorizationBearer <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

HeaderValue
AuthorizationBearer <YOUR_JWT_TOKEN>

Input Parameters

ParameterData TypeDescription
namestringThe name of the workflow definition.
descriptionstringThe description of the workflow definition.
tagsstring[]The tags of the workflow definition.
stepsDSLWorkflowStep[]The steps of the workflow definition.
varsRecord<string, any>The variables of the workflow definition.
optionsDSLActivityOptionsThe options of the workflow definition.
resultstringThe result of the workflow definition.
debug_modebooleanThe 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

HeaderValue
AuthorizationBearer <YOUR_JWT_TOKEN>

Path Parameters

ParameterDescription
<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

HeaderValue
AuthorizationBearer <YOUR_JWT_TOKEN>

Path Parameters

ParameterDescription
<WORKFLOW_DEFINITION_ID>The ID of the workflow definition to update.

Input Parameters

ParameterData TypeDescription
namestringThe name of the workflow definition.
descriptionstringThe description of the workflow definition.
tagsstring[]The tags of the workflow definition.
stepsDSLWorkflowStep[]The steps of the workflow definition.
varsRecord<string, any>The variables of the workflow definition.
optionsDSLActivityOptionsThe options of the workflow definition.
resultstringThe result of the workflow definition.
debug_modebooleanThe 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

HeaderValue
AuthorizationBearer <YOUR_JWT_TOKEN>

Path Parameters

ParameterDescription
<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>'

Was this page helpful?