Chuyển tới nội dung chính

Get Task

RCA.Activities.Core.GetTask

Description​

With this activity, you can get a task from the system. Retrieves a list of Center tasks according to a custom filter, using the Center API (GET /api/jobs-processing/v1).

The activity offers two interface modes to configure your search filters: the visual Filter Builder and the Where Condition editor.

get-task-filter-builder

get-task-where-condition

(* for Mandatory)

In the body of activity​

  • Where – Click here to specify the filter conditions used to retrieve tasks. You can use Filter Builder or Where Condition to configure the filter logic.

Filter modes​

Use the swap button next to Where to switch between the two modes:

ModeHow to useWhat is sent to Center
Filter Builder (default)Click the Where field to open the visual builder. Add one or more conditions (Field / Operator / Value), and choose AND or OR.Activity builds the query from the conditions plus Page, Size, and Newest First.
Where ConditionSwitch to Where Condition and type (or bind) the full API query string.The string is appended to /api/jobs-processing/v1? as-is. Page, Size, and Newest First are not applied in this mode — include page, size, and sort in the query yourself if needed.

Filter Builder rules

  • At least one filter condition is required.
  • AND – each field name can appear only once.
  • OR – all conditions must use the same field. Supported OR fields: state, environmentId, robotId, workflowId, source, scheduleId.

Filter Builder fields

Display nameField nameType
StatestateString
Environment IDenvironmentIdInt32
Robot IDrobotIdInt32
Workflow IDworkFlowIdInt32
Schedule IDscheduleIdInt32
SourcesourceString
Start TimestartTimeDateTime
End TimeendTimeDateTime
Created DatecreatedDateDateTime

Where Condition example

page=0&size=10&sort=id,desc&state=PENDING&state=RUNNING&fromDate=2026-07-01T00:00:00.000Z&toDate=2026-07-31T23:59:59.000Z

Properties​

Common

  • Continue On Error (Boolean) - Specifies to continue executing the remaining activities even if the current activity failed. Only boolean values (True, False) are supported.
  • Timeout MS (Int32) - The maximum time (in milliseconds) to wait for the activity to complete before throwing an error. If the timeout is reached, the activity stops execution. The default value is 30000 (milliseconds).

Input

  • Page (Int32) - The page number of the tasks to retrieve. Default is 0. Used in Filter Builder mode. Must be greater than or equal to 0.
  • Size (Int32) - The number of tasks to retrieve per page. Default is 10. Used in Filter Builder mode. Must be greater than 0.
  • Where Condition (String) - Specifies the filtering conditions used to retrieve tasks. Used when the activity is switched to Where Condition mode. Example: page=0&size=10&sort=id,asc&state=PENDING.

Misc

  • Public (Checkbox) - If you check it, the data of this activity will be shown in the log. Be careful, consider data security before using it.
  • Display Name (String) - The name of this activity. You can edit the name of the activity to organize and structure your code better.

Options

  • Newest First (Boolean) - Set to True to sort tasks by id in descending order (sort=id,desc). Set to False to sort in ascending order (sort=id,asc). Default is True. Used in Filter Builder mode only.

Output

  • Result Tasks (OutArgument<IEnumerable<TaskModel>>) - The retrieved tasks.

State​

Filter field: state.

Valid values (JobState). The activity sends them to Center in UPPERCASE:

ValueDescription
PENDINGWaiting to run
RUNNINGCurrently executing
STOPPINGStop requested
TERMINATINGBeing terminated
FAULTEDFailed
SUCCESSFULCompleted successfully
STOPPEDStopped

Examples:

state=PENDING
state=RUNNING

With OR (Filter Builder) or repeated parameters (Where Condition), you can request multiple states, for example state=PENDING&state=RUNNING.

Note: The Center API may default to PENDING,RUNNING when state is omitted. This activity does not add a default state — only the filters you configure are sent.

Source​

Filter field: source.

Valid values (JobSource). The activity sends them to Center in UPPERCASE:

ValueDescription
MANUALStarted manually
SCHEDULEStarted by schedule
AGENTStarted from Agent
CONFIRMATIONConfirmation flow
TRIGGERTrigger
PROCESSProcess
POOLAgent Pool
DESKTOP_TRIGGERDesktop trigger

Example:

source=SCHEDULE

Date / time format​

Date filters: Start Time (startTime), End Time (endTime), Created Date (createdDate).

In Filter Builder mode, these fields are mapped to the Center query parameters:

  • fromDate
  • toDate

Format sent to Center (UTC):

yyyy-MM-ddTHH:mm:ss.fffZ

Examples:

2026-07-15T00:00:00.000Z
2026-07-31T14:30:00.000Z

If you pass a DateTime / DateTimeOffset value in Filter Builder, the activity converts it to UTC and formats it as above. DateTimeKind.Unspecified is treated as local time, then converted to UTC.

Operator mapping (Filter Builder, AND):

FieldOperatorAPI parameter
startTime / createdDateEQUAL or GREATER_THAN*fromDate
startTime / createdDateLESS_THAN*toDate
endTimeEQUAL or LESS_THAN*toDate
endTimeGREATER_THAN*fromDate

If both fromDate and toDate are set and toDate is earlier than fromDate, the activity throws a validation error.

Where Condition example:

page=0&size=10&sort=id,desc&fromDate=2026-07-01T00:00:00.000Z&toDate=2026-07-31T23:59:59.000Z

Where to get IDs on Center​

Use these numeric IDs in Filter Builder or Where Condition:

Filter (designer)API query parameterWhere to find it on Center
Environment IDenvironmentIdAgent → Environments. Open the environment detail page; take the ID from the URL, or from the environments list API.
Robot IDrobotIdAgent → Agents / Robots. Open the agent detail page; take the ID from the URL, or from the agents list API.
Workflow IDworkflowIdAutomation → Workflows. Open the workflow detail page; take the ID from the URL, or from the workflows list API.
Schedule IDscheduleIdAutomation → Schedules. Open the schedule detail page; take the ID from the URL, or from the schedules list API.

Other ways to obtain IDs:

  1. Center UI URL – open the detail page of the Environment / Agent / Workflow / Schedule and read the numeric ID from the browser URL.
  2. Swagger / Admin API docs – open {CenterUrl}/#/admin/docs, call the related list API, and read the id field.
  3. From a previous Get Task result – TaskModel already exposes:
    • EnvironmentId
    • RobotId
    • WorkFlowId
    • ProcessSchedulesId (schedule)

Examples:

environmentId=12
robotId=45
workflowId=108
scheduleId=33

Example​

Filter Builder

Get Task
Page = 0
Size = 10
Newest First = True
Where = State Equal PENDING
AND Environment ID Equal 12
Result Tasks = tasks

Where Condition

Get Task
Where Condition = "page=0&size=10&sort=id,desc&state=PENDING&environmentId=12"
Result Tasks = tasks