Skip to main content

Task configuration

In this section, you will learn more about the task envelope and its possibilities.

A task in Taskurai consists of a uniform envelope that can contain custom properties. This way, tasks can be handled uniformly by developers, service desks, and help desks.

Reference task configuration

Here is an example task:

id: 5e41080b-8599-4ad5-b6f4-d5cf38f49186
config:
command: testCommand
arguments:
- name: purchaseOrderId
data: 3000911e-ef4f-4420-9271-abd03373de32
- name: formatting
data:
paperSize: Letter
orientation: Portrait
- name: mailing
sensitive: true
data:
includePurchaseOrderAttachment: true
recipients:
- purchase@company.net
- finance@company.net
secrets: []
category: Purchase
subject: Generate purchase order and email
description: Generate purchase order PDF and email to recipients.
externalId: PO-578934
tags: {}
isolationMode: true
isolationKey: dd10b001-addd-45c2-94a6-932282b7515c
correlationId: 5e41080b-8599-4ad5-b6f4-d5cf38f49186
traceParent: 00-5e41080b85994ad5b6f4d5cf38f49186-9d2199efe6a42807-01
id: 5e41080b-8599-4ad5-b6f4-d5cf38f49186
created: '2026-03-27T16:01:40.1667634+00:00'
createdBy: d8e9cb3f-ffeb-4915-bb15-6681a3bcd175
modified: '2026-03-27T16:01:40.2851177+00:00'
modifiedBy: d8e9cb3f-ffeb-4915-bb15-6681a3bcd175
status: created
archived: false
postponed: false
deleting: false
correlationId: 5e41080b-8599-4ad5-b6f4-d5cf38f49186
defaultStateStore: DefaultStateStore

Task properties

PropertyTypeRequiredDescription
idstringYesTask ID
configTask configurationYesTask configuration
createdDateTimeOffsetYesTask created
modifiedDateTimeOffsetNoTask modified
startAfterDateTimeOffsetNoTask start after
notStartAfterDateTimeOffsetNoTask not start after
startedDateTimeOffsetNoTask started
runStartedDateTimeOffsetNoTask run started
retryAfterDateTimeOffsetNoTask retry after
stoppedDateTimeOffsetNoTask stopped
statusTask statusNoTask status
statusCodeTask status codeNoTask status code
retryStatusTask retry statusNoTask retry status
progressTask progressNoTask progress
resultTask resultNoTask result
errorTask errorNoTask error
archivedbooleanNoTask archived
postponedbooleanNoTask postponed
deletingbooleanNoTask deleting
runCountlongNoTask run count
correlationIdstringNoTask correlation id
workerNamestringNoTask worker name where the last run of the task occurred
workerImagestringNoTask worker image where the last run of the task occurred
defaultStateStorestringNoTask default state store
cleanupStateAfterSecondsintNoTask cleanup state after seconds.

Task configuration

Some properties have fixed usage, such as:

PropertyTypeRequiredDescription
idstringYesTask ID
commandstringYesTask command
argumentsList of Task argumentsNoTask arguments
secretsList of Task secretsNoTask secrets
executionOptionsExecution optionsNoTask execution options
unlistedbooleanNoMark task as unlisted
isolationModebooleanNoRun the task in isolation mode
isolationKeystringNoIsolation key
correlationIdstringNoOverride the task correlation id
parentIdstringNoTask parent ID

Other properties are commonly used but can be used in a way that suits your case best:

PropertyTypeRequiredDescription
categorystringNoTask category
subjectstringNoTask subject
descriptionstringNoTask description
externalIdstringNoTask external ID
externalAccountIdstringNoTask external account ID
externalUserIdstringNoTask external user ID
tagsobjectNoTask tags (dictionary)

Usually, the category and subject are used to provide additional information about tasks, such as:

  • category: "Purchase", "Data processing", etc.
  • subject: "Confirmation email for Contoso", "Processing upload myimage.png", etc.

The unlisted property is used to filter out internal tasks that you don't want to show in the end-user application.

You can choose whether the task contains all the data for the command or if the command looks up extra data afterwards.

info

The total size of the task is limited to 2 MB.

To pass in or return large quantities of data, use state management. The task arguments and task output can contain state references.

Using versioned commands

When commands are set up to be versioned, you can use specific versions of a command by using the following syntax:

commandName@version

caution

Before creating tasks with new command versions, ensure that workers containing the new versions are deployed.

Arguments

The task can optionally pass arguments to the task command:

PropertyTypeRequiredDescription
namestringYesArgument name
typestringNoArgument type
datastringNoArgument value
stateReferencestringNoArgument state reference (state id)
secretReferencestringNoArgument secret reference (task secret name)
sensitivebooleanNoConsider this argument as sensitive (only return when scope Data/Buildby.Taskurai/sensitive/read is available)

Secrets

The task can optionally pass secrets to the task command:

PropertyTypeRequiredDescription
namestringYesSecret name
valuestringNoSecret value
secretReferencestringNoSecret secret reference (global secret name) (only when scope Data/Buildby.Taskurai/secrets/read is available)

While it is technically possible to define a secret value directly in the task configuration, it is highly recommended to use globally defined secrets in Taskurai and reference them in the task.

When passing in secrets as a value, do not include secrets in source code.

Secrets values can only be read by workers with a access token that has the scope Data/Buildby.Taskurai/secrets/read.

Execution options

PropertyTypeRequiredDescription
defaultRetryPolicyRetryPolicyNoDefault retry policy
timeoutRetryPolicyRetryPolicyNoTimeout retry policy
intermediateFailureRetryPolicyRetryPolicyNoIntermediate failure retry policy
failureRetryPolicyRetryPolicyNoFailure retry policy
maxDurationlongNoMaximum duration in seconds
startAfterAfterNoConfigure scheduled start
notStartAfterAfterNoMark task as expired if not started after (seconds or fixed date time).

Retry policy

The retry policy configures how tasks are retried on completion:

PropertyTypeRequiredDefaultDescription
InitialDelaySecdoubleNo15The delay between retry attempts for a fixed approach or the delay on which to base calculations for a backoff-based approach. If the command provides a retryAfter response, the next retry is delayed by the duration specified by the retryAfter value. (Default: 15 sec, max 7 days).
MaxRunsintNoMax task runs (-1: unlimited, 0: single execution attempt, no retry, >= 1: total number of attempts/retries).
MaximumDelaySecdoubleNo60The maximum delay between retry attempts when the command doesn't provide a retryAfter response. If the service provides a retryAfter response, the next retry is delayed by the duration specified by the header value. (default 60 sec, max 7 days).
RetryModeRetryModeNoExponentialMethod to calculate retry delays (default: Exponential).

Default retry policies

PolicyInitialDelaySecMaxRunsMaximumDelaySecRetryMode
DefaultRetryPolicy1503600Exponential
TimeoutRetryPolicy1553600Exponential
IntermediateFailureRetryPolicy15103600Exponential
FailureRetryPolicy1553600Exponential
info

The following task statuses will never be retried:

  • Succeeded
  • Canceled
  • Fatal

The DefaultRetryPolicy will handle all task statuses not explicitly handled by the other policies.

Progress

While a task is running, a command can store intermediate progress reports for other applications to read. For example, to provide some interaction to the end-user or help desk:

PropertyTypeRequiredDescription
percentagedoubleNoTask percentage (0.0-100.0)
messagestringNoProgress message
heartbeatDateTimeOffsetNoHeartbeat date time

Task Status

The following task statuses are possible:

StatusDescription
CreatingTask is creating
CreatedTask is created
ExpiredTask is expired
ScheduledTask is scheduled
RunningTask is running
RetryScheduledTask retry is scheduled
SuspendedTask is suspended
WaitingForEventsTask is waiting for events
CallTasksTask is calling sub tasks
ResumingTask is resuming
SucceededTask is succeeded
TimeoutTask is timed out
FailedTask is failed
FatalTask is fatal
CanceledTask is canceled
IntermediateFailureTask has failed in an intermediate state (will not be dequeued and be retried)
PostponedTask has been created but is not queued yet

The status codes Expired, Succeeded, Timeout, Failed, Fatal and Canceled are considered final states.

Status Code

The status code can be used to provide more details about the task status. HTTP response status codes are used.

Retry status

The following retry status codes are possible:

StatusDescription
ScheduledTask retry is scheduled
RetryingTask is retrying
StoppedTask retry is stopped

Result

The result can be set either during the execution of a task or when a task is complete. It can contain the following data as free-form fields:

PropertyTypeRequiredDescription
outputlist of Result outputNoResult output
messageslist of Result messageNoResult messages

Result output

Task result message:

PropertyTypeRequiredDescription
namestringNoOptional output name
typestringNoOptional output type
valuestringNoOutput value
stateReferencestringNoOutput state reference (state id)
sensitivebooleanNoConsider this output as sensitive (only return when scope Data/Buildby.Taskurai/sensitive/read is available)

Result message

Task result message:

PropertyTypeRequiredDescription
codestringYesMessage code
messagestringYesMessage
detailsList of Result messageNoList of message details

Error

If an error occurs while executing the task, the following fields can be used to report it:

PropertyTypeRequiredDescription
codestringYesError code
messagestringYesError message
detailsList of ErrorNoList of errors