API / Task queue public APIs

Task queue public APIs

Create a task

Request method

POST

Protocol

HTTP

Request

http://example.com:48080/v1/orchestra/task/create

Request body:

{
"auth_tkn":"5d5ec66f-357d-4c2d-bbc1-2012278d2361",
"task":
    {
    "process":"c39f99de-cb8f-4661-a206-b282a4830cbf",
    "version":0,
    "ctx": "{\"StringParam_in\":\"String value\",\"FileParam_in\":\"http://127.0.0.1:8088/v1/task/download_elma?uid=c054ab8e-cd33-429e-b4f3-7f61abcfd381&system=5d5ec66f-357d-4c2d-bbc1-2012278d2361\",\"DateTimeParam_in\":\"2020-03-22T00:00:00Z\",\"BoolParam_in\":true,\"DoubleParam_in\":12.2,\"IntParam_in\":76,\"ArrayParam_in\":[\"http://127.0.0.1:8088/v1/task/download_elma?uid=c054ab8e-cd33-429e-b4f3-7f61abcfd381&system=5d5ec66f-357d-4c2d-bbc1-2012278d2361\",\"http://127.0.0.1:8088/v1/task/download_elma?uid=c054ab8e-cd33-429e-b4f3-7f61abcfd381&system=5d5ec66f-357d-4c2d-bbc1-2012278d2361\"]}"
    }
}

Parameter

Description

auth_tkn

External system identifier

process

Process token

version

Process version or 0 if you need to obtain the process current version data (process)

ctx

String representing the json of the input context

Server response example:

{
    "status": 201,
    "task": {
        "id": 955,
        "process": "c39f99de-cb8f-4661-a206-b282a4830cbf",
        "system": "5d5ec66f-357d-4c2d-bbc1-2012278d2361",
        "priority": "MEDIUM",
        "status": "PREPARE",
        "metrics": {},
        "created": "2020-06-29T14:29:52+04:00",
        "updated": "2020-06-29T14:29:52+04:00"
    }
}

You can find the description of the server response in the the task data request.

The task data request

Request method

POST

Protocol

HTTP

Request

http://example.com:48080/v1/orchestra/task/status

Request body:

{
    "auth_tkn":"5d5ec66f-357d-4c2d-bbc1-2012278d2362",
    "id":955
}

Parameter

Description

auth_tkn

External system identifier

id

Identifier of the task returned by the server when it was created

Cancel a task in queue

Request method

POST

Protocol

HTTP

Request

http://example.com:48080/v1/orchestra/task/cancel

Request body:

{
   "auth_tkn":"5d5ec66f-357d-4c2d-bbc1-2012278d2362",
   "id":955
}

Parameter

Description

auth_tkn

External system identifier

id

Identifier of the task returned by the server when it was created

A task can be deleted only by the system that created it.

Server response example:

  • the task is in queue;

{
    "status": 201,
    "task": {
        "id": 955,
        "process": "c39f99de-cb8f-4661-a206-b282a4830cbf",
        "system": "5d5ec66f-357d-4c2d-bbc1-2012278d2361",
        "priority": "MEDIUM",
        "status": "PREPARE",
        "metrics": {},
        "created": "2020-06-29T14:29:52+04:00",
        "updated": "2020-06-29T14:29:52+04:00"
    }
}

  • the task completed successfully;

{
    "status": 200,
    "task": {
        "id": 955,
        "process": "c39f99de-cb8f-4661-a206-b282a4830cbf",
        "ctx": "6e01adcb-de15-475f-86fa-b5d3a78a2d14",
        "system": "5d5ec66f-357d-4c2d-bbc1-2012278d2361",
        "priority": "MEDIUM",
        "groups": [
            "8f6895c5-70a5-498f-b813-ab72e2b6e5f0"
        ],
        "status": "DONE",
        "bot": "5e771afd-1261-4451-b059-4543d41a5814",
        "outputCtx": "{\r\n  \"stringvalue_out\": \" (changed script)\",\r\n  \"filevalue_out\": null,\r\n  \"datetimevalue_out\": \"2020-06-29T11:08:29.2068223Z\",\r\n  \"boolvalue_out\": true,\r\n  \"doublevalue_out\": 0.1,\r\n  \"intvalue_out\": 7\r\n}",
        "log": "[INF] 2020/06/29 14:08:23 | [ELMA.RPA.Bot.Server.RepositoryTask] | Started preparing a task for the bot.\n[INF] 2020/06/29 14:08:23 | [ELMA.RPA.Bot.Server.RepositoryTask] | Task context configured `example.com:14588` and return client for connect.\n[INF] 2020/06/29 14:08:23 | [ELMA.RPA.Services.Cache] | Try get process from cache\n[INF] 2020/06/29 14:08:23 | [ELMA.RPA.SDK.Serialization.StoredPackaged] | Start deserialize object of type `RpaProcess`.\n[INF] 2020/06/29 14:08:24 | [ELMA.RPA.SDK.Serialization.StoredPackaged] | End deserialize object of type `RpaProcess`.\n[INF] 2020/06/29 14:08:24 | [ELMA.RPA.SDK.Serialization.StoredPackaged] | Start deserialize object of type `Dictionary`2`.\n[INF] 2020/06/29 14:08:24 | [ELMA.RPA.SDK.Serialization.StoredPackaged] | End deserialize object of type `Dictionary`2`.\n[INF] 2020/06/29 14:08:24 | [ELMA.RPA.Player.PlayerService] | Executing process 'Creating profiles' (token c39f99de-cb8f-4661-a206-b282a4830cbf) with parameters: ('stringvalue_in' => ')', ('filevalue_in' => ')', ('datetimevalue_in' => '01.01.0001 3:00:00)', ('boolvalue_in' => ')', ('doublevalue_in' => '0,1)', ('intvalue_in' => ')', ('stringvalue_out' => ')', ('filevalue_out' => ')', ('datetimevalue_out' => ')', ('boolvalue_out' => ')', ('doublevalue_out' => ')', ('intvalue_out' => '123)', ('DirectoryContext' => 'C:\\Users\\User\\AppData\\Local\\ELMA_RPA\\context)'.\n[INF] 2020/06/29 14:08:24 | [ELMA.RPA.Services.EmulatorService] | Emulator initizlized.\n[INF] 2020/06/29 14:08:24 | [ELMA.RPA.Services.ClipboardService] | Clipboard cleared.\n[INF] 2020/06/29 14:08:24 | [ELMA.RPA.HotKeys.Services.HotKeysService] | Hot key registered: id 200, modifier Alt, Control, key B.\n[INF] 2020/06/29 14:08:24 | [ELMA.RPA.UI.Common.UiService] | Show PLAY label.\n[INF] 2020/06/29 14:08:24 | [ELMA.RPA.Player.PlayerService] | Executing StartActivity (UID e335bbf8-8327-4f7e-a546-78c5456bce51).\n[INF] 2020/06/29 14:08:24 | [ELMA.RPA.Player.PlayerService] | Executing ActionActivity (UID ef68fdb9-5d20-4b9a-8d8e-8e1bb95af97a).\n[INF] 2020/06/29 14:08:29 | [ELMA.RPA.Player.PlayerService] | Executing FinishActivity (UID bc1fc847-c477-4efc-aaa4-1417f10df88f).\n[INF] 2020/06/29 14:08:29 | [ELMA.RPA.HotKeys.Services.HotKeysService] | Hot key unregistered: id 200.\n[INF] 2020/06/29 14:08:29 | [ELMA.RPA.Services.ClipboardService] | Clipboard cleared.\n[INF] 2020/06/29 14:08:29 | [ELMA.RPA.UI.Common.UiService] | Hide PLAY label.\n[INF] 2020/06/29 14:08:29 | [ELMA.RPA.Player.PlayerService] | Process 'Creating profiles' (token c39f99de-cb8f-4661-a206-b282a4830cbf) completed!\n",
        "metrics": {
            "startTime": "0001-01-01T00:00:00Z",
            "endTime": "0001-01-01T00:00:00Z"
        },
        "created": "2020-06-29T10:29:52Z",
        "updated": "2020-06-29T11:08:29Z"
    }
}

Parameter

Description

status

Numeric code of the request execution result (HTTP status codes are used)

task

Task info

id

Task identifier

process

Process token

system

Uuid of the system that set the task

priority

Task priority (the accepted values are: EMPTY_P, HIGH, MEDIUM, LOW)

status

Task status (the accepted values are: EMPTY_ST, QUEUE, EXECUTING, DONE, ERROR, PREPARE)

bot

The bot the task was set to

outputCtx

String representing the json of the output context

log

Task execution log

startTime

Date and time the bot started the process

endTime

Date and time the bot completed the process

created

Date and time the Orchestrator received the task

endTime

Date and time of the last task information update

Get a file from the output context of the completed task

Request method

POST

Protocol

HTTP

Request

http://example.com:48080/v1/repository/task/download

Request body:

{
    "auth_tkn":"5d5ec66f-357d-4c2d-bbc1-2012278d2362",
    "taskid":717,
    "filename":"12.txt"
}

Parameter

Description

auth_tkn

External system identifier

taskid

Identifier of the task returned by the server when it was created

filename

Output context file name

In response to that, the file is sent.