docs-v2/content/influxdb/v2.1/process-data/task-options.md

2.4 KiB

title seotitle description menu weight influxdb/v2.1/tags
Task configuration options InfluxDB task configuration options Task options define specific information about a task such as its name, the schedule on which it runs, execution delays, and others.
influxdb_2_1
name parent
Task options Process data
105
tasks
flux

Task options define specific information about a task. They are set in a Flux script or in the InfluxDB user interface (UI). The following task options are available:

{{% note %}} every and cron are mutually exclusive, but at least one is required. {{% /note %}}

name

The name of the task. Required.

Data type: String

option task = {
  name: "taskName",
  // ...
}

every

The interval at which the task runs. This option also determines when the task first starts to run, depending on the specified time (in [duration literal](/{{< latest "flux" >}}/spec/lexical-elements/#duration-literals)).

Data type: Duration

option task = {
  // ...
  every: 1h,
}

For example, if you save or schedule a task at 2:30 and run the task every hour (1h):

option task = {name: "aggregation", every: 1h}

The task first executes at 3:00pm, and subsequently every hour after that.

{{% note %}} In the InfluxDB UI, the Interval field sets this option. {{% /note %}}

cron

The cron expression that defines the schedule on which the task runs. Cron scheduling is based on system time.

Data type: String

option task = {
  // ...
  cron: "0 * * * *",
}

offset

Delays the execution of the task but preserves the original time range. For example, if a task is to run on the hour, a 10m offset will delay it to 10 minutes after the hour, but all time ranges defined in the task are relative to the specified execution time. A common use case is offsetting execution to account for data that may arrive late.

Data type: Duration

option task = {
  // ...
  offset: 10m,
}

concurrency

The number task of executions that can run concurrently. If the concurrency limit is reached, all subsequent executions are queued until other running task executions complete.

Data type: Integer

option task = {
  // ...
  concurrency: 2,
}