Skip to content

Worker Template


Endpoints

GET       /worker_templates
GET       /worker_templates/:id

A worker template is a reusable definition of a digital worker, including its source code, form inputs, form outputs, and runtime configuration. Worker templates are used to instantiate workers within workflows.

The worker template object

What a worker template object looks like?

{
  "id": "wtpl_Lm5nOpQrSt6UvWx7YzAb8CdEf",
  "name": "My Worker Template",
  "description": "This is my first worker template",
  "category": "ANALYTICS",
  "visible": true,
  "type": "BASIC",
  "script_runtime": "python3.11",
  "script_entry_point": "main",
  "run_locally": false,
  "container_status": "SUCCESS",
  "tags": ["first", "worker", "20210622"],
  "created": 1625598288,
  "updated": 1625598288
}
Property Description
id string Unique identifier (UID) for the worker template.
created timestamp Time at which the object was created. Measured in seconds since the Unix epoch.
updated timestamp Time at which the object was updated. Measured in seconds since the Unix epoch.
name string The name of the worker template.
description string An arbitrary string attached to the worker template. Often useful for finding detailed information about the worker template or for filtering a search based on the present hashtags.
tags array Sequence of hashtags used to find the related worker template. The more hashtags that are used, the more elements that are filtered out from the search. Labels, dates and any other hashtag can be used.
category string The category this worker template belongs to.
version string Indicates the worker template's current version.
visible boolean Whether the worker template is visible to users in the workflow editor.
type string The worker type (e.g. BASIC).
script_runtime string The runtime environment used to execute the worker's script (e.g. python3.11).
script_entry_point string The entry point function called when the worker executes.
run_locally boolean Whether the worker runs in the local environment rather than a container.
container_status string The deployment status of the worker container. It can be PENDING, SUCCESS or ERROR.

List all worker templates

Returns a list of worker templates. The worker templates are returned in sorted order, with the most recent appearing first.

To list all worker templates, run the following:

curl https://api.everysk.com/v2/worker_templates?query=#analytics \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <ACCESS_TOKEN>" \
  -G

The above call returns the following JSON object:

{
  "worker_templates": [
    {
      "id": "wtpl_Lm5nOpQrSt6UvWx7YzAb8CdEf",
      "name": "My Worker Template",
      "description": "This is my first worker template",
      "category": "ANALYTICS",
      "visible": true,
      "type": "BASIC",
      "script_runtime": "python3.11",
      "script_entry_point": "main",
      "run_locally": false,
      "container_status": "SUCCESS",
      "tags": ["first", "worker", "20210622"],
      "created": 1625598288,
      "updated": 1625598288
    },
    ...
  ],
  "next_page_token": null
}

HTTP Request

GET /worker_templates

HTTP Parameters

Parameter Description
query string optional, default is null Request a list of worker templates filtering it by name or tag. When using a tag to perform a query, each term must include a hashtag prefix. (e.g: query="#april #sample") See Filter with query.
page_size integer optional, default is 10 Set the number of objects that will be listed per page.
page_token integer optional, default is null The token defines which page will be returned to the user. For further information, please check out our pagination guide.

Retrieve a worker template

Retrieves the details of an existing worker template by supplying its id.

To retrieve a worker template, run the following:

curl https://api.everysk.com/v2/worker_templates/wtpl_Lm5nOpQrSt6UvWx7YzAb8CdEf \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <ACCESS_TOKEN>" \
  -G

The above call returns the following JSON object:

{
  "worker_template": {
    "id": "wtpl_Lm5nOpQrSt6UvWx7YzAb8CdEf",
    "name": "My Worker Template",
    "description": "This is my first worker template",
    "category": "ANALYTICS",
    "visible": true,
    "type": "BASIC",
    "form_inputs": [],
    "script_runtime": "python3.11",
    "script_entry_point": "main",
    "container_status": "SUCCESS",
    "tags": ["first", "worker", "20210622"],
    "created": 1625598288,
    "updated": 1625598288
  }
}

HTTP Request

GET /worker_templates/:id

HTTP Parameters

Parameter Description
id string REQUIRED A unique identifier (UID) for a worker template. A worker template's id will always look like this: wtpl_Lm5nOpQrSt6....