# InfluxDB

> Write sensor readings and other data points to InfluxDB from workflows, read a field's latest or average value, run Flux queries, manage buckets and run tasks. Start a workflow when a value crosses a threshold, a task fails or a check changes status.

App · 11 actions. Web page: https://docs.lodol.com/docs/integrations/influxdb

## Actions

### Create bucket

Create a bucket that keeps data for as long as you choose, such as for a new site or customer. One of that name already there is returned as it is.

**Inputs**

- Name (`name`, text, required): The bucket's name, such as site-amsterdam.
- Keep data for (`retention`, text): How long to keep each point, such as 30d, 12w or 1y (at least 1h). Leave blank to keep data forever.
- Description (`description`, text): What the bucket is for.

**Outputs**

- `created` (true/false): True if it was made now; false if a bucket of that name was there
- `created_at` (text): When it was made
- `description` (text): Its description
- `id` (text): The bucket's ID
- `link` (text): Where to open it in InfluxDB
- `name` (text): Its name
- `retention` (text): How long it keeps data, such as 30 days, or Forever
- `retention_seconds` (number): How long it keeps data, in seconds; 0 is forever
- `type` (text): user, or system for InfluxDB's own buckets
- `updated_at` (text): When it last changed

**Example output**

```json
{
  "created": true,
  "created_at": "2026-05-01T10:00:00Z",
  "description": "Room sensors",
  "id": "fbc3488665d01e58",
  "link": "https://us-east-1-1.aws.cloud2.influxdata.com/orgs/3a50d630fdda09d3/load-data/buckets/fbc3488665d01e58",
  "name": "sensors",
  "retention": "30 days",
  "retention_seconds": 2592000,
  "type": "user",
  "updated_at": "2026-05-01T10:00:00Z"
}
```

### Delete bucket

Delete a bucket and every point in it. This can't be undone.

**Inputs**

- Bucket (`bucket`, text, required): The bucket to delete: its name or ID.

**Outputs**

- `deleted` (true/false): True once it's gone
- `id` (text): The deleted bucket's ID
- `name` (text): Its name

**Example output**

```json
{
  "deleted": true,
  "id": "fbc3488665d01e58",
  "name": "sensors-old"
}
```

### Delete data

Delete a measurement's points in a time range, such as a faulty sensor's readings, optionally only those with some tag values. This can't be undone.

**Inputs**

- Bucket (`bucket`, text, required): The bucket to delete from.
- Measurement (`measurement`, text, required): The measurement whose points to delete.
- From (`start`, date and time, required): Delete points from this time on.
- Until (`stop`, date and time): Delete points up to this time. Leave blank for now.
- Tag filters (`filters`, object): Only points with these tag values, such as sensor_id th-09. Leave blank for all of the measurement's points.

**Outputs**

- `bucket` (text): The bucket
- `measurement` (text): The measurement whose points were deleted
- `predicate` (text): Which points, as InfluxDB was asked
- `start` (text): From when, in UTC
- `stop` (text): Until when, in UTC

**Example output**

```json
{
  "bucket": "sensors",
  "measurement": "environment",
  "predicate": "_measurement=\"environment\" AND \"sensor_id\"=\"th-09\"",
  "start": "2026-05-01T00:00:00Z",
  "stop": "2026-05-02T00:00:00Z"
}
```

### Get field value

Read a field's latest, average, highest, lowest or total value over the last hour, day or week, such as a room's temperature, without writing a query. Narrow it by tags.

**Inputs**

- Bucket (`bucket`, text, required): The bucket to read.
- Measurement (`measurement`, text, required): The measurement, such as environment.
- Field (`field`, text, required): The field, such as temperature.
- Tag filters (`filters`, object): Only points with these tag values, such as room kitchen. Leave blank for every series.
- Over the last (`time_range`, text): How far back to look, such as 15m, 1h, 24h or 7d. Defaults to 1h. Default: `1h`.
- Value (`aggregate`, text): Which value: the latest, or the points combined. One of: `last` (Latest value), `first` (Earliest value), `mean` (Average), `min` (Lowest), `max` (Highest), `sum` (Total), `count` (Number of points). Default: `last`.

**Outputs**

- `aggregate` (text): How the points were combined: last, first, mean, min, max, sum or count
- `bucket` (text): The bucket read
- `field` (text): The field read
- `found` (true/false): Whether there were any points in the time range
- `measurement` (text): The measurement read
- `series` (list): The value for each series (each set of tags) on its own
- `series_count` (number): How many series matched
- `time` (text): When that value was recorded (latest and earliest only)
- `time_range` (text): How far back it looked, such as 1h
- `value` (number): The value: the latest, average, highest and so on, over every series matched together. Empty when there were no points.

**Example output**

```json
{
  "aggregate": "last",
  "bucket": "sensors",
  "field": "temperature",
  "found": true,
  "measurement": "environment",
  "series": [
    {
      "series": "room=kitchen,sensor_id=th-01",
      "tags": {
        "room": "kitchen",
        "sensor_id": "th-01"
      },
      "time": "2026-05-04T09:25:00Z",
      "value": 21.5
    },
    {
      "series": "room=server room,sensor_id=th-03",
      "tags": {
        "room": "server room",
        "sensor_id": "th-03"
      },
      "time": "2026-05-04T09:29:00Z",
      "value": 24.1
    }
  ],
  "series_count": 2,
  "time": "2026-05-04T09:29:00Z",
  "time_range": "1h",
  "value": 24.1
}
```

### List buckets

List the buckets in your organization, with how long each keeps data.

**Inputs**

- Include InfluxDB's own (`include_system`, true/false): Also list _monitoring and _tasks, where InfluxDB keeps check statuses and task logs. Default: `false`.
- How many (`limit`, number): The most to list. Defaults to 25. From 1 to 100.

**Outputs**

- `buckets` (list): The buckets, by name
- `count` (number): How many are listed
- `total` (number): How many there are in all

**Example output**

```json
{
  "buckets": [
    {
      "created_at": "2026-05-01T10:00:00Z",
      "description": "",
      "id": "0a1b2c3d4e5f6071",
      "link": "https://us-east-1-1.aws.cloud2.influxdata.com/orgs/3a50d630fdda09d3/load-data/buckets/0a1b2c3d4e5f6071",
      "name": "energy",
      "retention": "Forever",
      "retention_seconds": 0,
      "type": "user",
      "updated_at": "2026-05-01T10:00:00Z"
    },
    {
      "created_at": "2026-05-01T10:00:00Z",
      "description": "Room sensors",
      "id": "fbc3488665d01e58",
      "link": "https://us-east-1-1.aws.cloud2.influxdata.com/orgs/3a50d630fdda09d3/load-data/buckets/fbc3488665d01e58",
      "name": "sensors",
      "retention": "30 days",
      "retention_seconds": 2592000,
      "type": "user",
      "updated_at": "2026-05-01T10:00:00Z"
    }
  ],
  "count": 2,
  "total": 2
}
```

### List task runs

List a task's recent runs, newest first, with how each went and why a failed one failed.

**Inputs**

- Task (`task`, text, required): The task: its name or ID.
- Status (`status`, text): Only runs that ended this way. One of: `failed`, `success` (Succeeded), `started` (Running), `scheduled`, `canceled`.
- How many (`limit`, number): The most runs to list. Defaults to 10. From 1 to 100.

**Outputs**

- `count` (number): How many are listed
- `runs` (list): Its runs, newest first
- `task_id` (text): The task's ID
- `task_name` (text): The task's name

**Example output**

```json
{
  "count": 1,
  "runs": [
    {
      "error": "",
      "finished_at": "2026-05-04T09:30:00.41Z",
      "id": "1198e11f970d3000",
      "link": "https://us-east-1-1.aws.cloud2.influxdata.com/orgs/3a50d630fdda09d3/tasks/1198e11b9f0d3000/runs",
      "log": [
        "Started task from script: \u2026",
        "Completed(success)"
      ],
      "requested_at": "2026-05-04T09:30:00Z",
      "scheduled_for": "2026-05-04T09:30:00Z",
      "started_at": "2026-05-04T09:30:00.32Z",
      "status": "success",
      "task_id": "1198e11b9f0d3000",
      "task_name": "Downsample sensors hourly"
    }
  ],
  "task_id": "1198e11b9f0d3000",
  "task_name": "Downsample sensors hourly"
}
```

### List tasks

List your tasks (scheduled Flux scripts) by name, with how often each runs and how its last run went.

**Inputs**

- Search (`search`, text): Words in the task's name or description.
- Status (`status`, text): Only active or only inactive tasks. One of: `active`, `inactive`.
- How many (`limit`, number): The most to list. Defaults to 25. From 1 to 100.

**Outputs**

- `count` (number): How many are listed
- `tasks` (list): The tasks, by name
- `total` (number): How many matched in all

**Example output**

```json
{
  "count": 1,
  "tasks": [
    {
      "cron": "",
      "description": "",
      "every": "1h",
      "id": "1198e11b9f0d3000",
      "last_run_error": "",
      "last_run_status": "success",
      "latest_completed": "2026-05-04T09:00:00Z",
      "link": "https://us-east-1-1.aws.cloud2.influxdata.com/orgs/3a50d630fdda09d3/tasks/1198e11b9f0d3000/runs",
      "name": "Downsample sensors hourly",
      "status": "active",
      "updated_at": "2026-05-01T10:00:00Z"
    }
  ],
  "total": 1
}
```

### Run Flux query

Run a Flux query and get its rows back as one list of records, with a key per column (_time, _value, _field and each tag).

**Inputs**

- Flux query (`query`, text, required): The query, such as from(bucket: "sensors") |> range(start: -1h) |> filter(fn: (r) => r._measurement == "environment").
- Most rows (`max_rows`, number): The most rows to return. Defaults to 100, up to 1000. From 1 to 1000.

**Outputs**

- `columns` (list): The columns the rows have
- `count` (number): How many rows came back
- `rows` (list): The rows, one record per row with a key per column the query returns, such as _time, _value, _field, _measurement and each tag
- `tables` (number): How many tables (series) the rows came from
- `truncated` (true/false): Whether there were more rows than the most asked for

**Example output**

```json
{
  "columns": [
    "_start",
    "_stop",
    "_time",
    "_value",
    "_field",
    "_measurement",
    "room"
  ],
  "count": 2,
  "rows": [
    {
      "_field": "temperature",
      "_measurement": "environment",
      "_start": "2026-05-04T08:30:00Z",
      "_stop": "2026-05-04T09:30:00Z",
      "_time": "2026-05-04T09:29:00Z",
      "_value": 21.5,
      "room": "kitchen"
    },
    {
      "_field": "temperature",
      "_measurement": "environment",
      "_start": "2026-05-04T08:30:00Z",
      "_stop": "2026-05-04T09:30:00Z",
      "_time": "2026-05-04T09:29:00Z",
      "_value": 24.1,
      "room": "server room"
    }
  ],
  "tables": 2,
  "truncated": false
}
```

### Run task

Run a task now, outside its schedule, such as to fill in a report before it's sent, and wait up to a minute for it to finish.

**Inputs**

- Task (`task`, text, required): The task: its name or ID.
- Wait for it (`wait`, true/false): Wait up to a minute for the run to finish and say how it went. Turn off to only start it. Default: `true`.

**Outputs**

- `error` (text): Why it failed, if it did
- `finished` (true/false): Whether the run finished within the minute Lodol waits
- `finished_at` (text): When it finished
- `id` (text): The run's ID
- `link` (text): Where to open the task's runs in InfluxDB
- `log` (list): Its log messages, oldest first
- `requested_at` (text): When it was asked for, for a run started by hand
- `scheduled_for` (text): The time the run is for
- `started_at` (text): When it started
- `status` (text): scheduled, started, success, failed or canceled
- `task_id` (text): The task's ID
- `task_name` (text): The task's name

**Example output**

```json
{
  "error": "",
  "finished": true,
  "finished_at": "2026-05-04T09:30:00.41Z",
  "id": "1198e11f970d3000",
  "link": "https://us-east-1-1.aws.cloud2.influxdata.com/orgs/3a50d630fdda09d3/tasks/1198e11b9f0d3000/runs",
  "log": [
    "Started task from script: \u2026",
    "Completed(success)"
  ],
  "requested_at": "2026-05-04T09:30:00Z",
  "scheduled_for": "2026-05-04T09:30:00Z",
  "started_at": "2026-05-04T09:30:00.32Z",
  "status": "success",
  "task_id": "1198e11b9f0d3000",
  "task_name": "Downsample sensors hourly"
}
```

### Write data point

Write one data point to a bucket, such as a sensor reading from a webhook or a number from a form: its measurement, tags and fields, at a time you give or now.

**Inputs**

- Bucket (`bucket`, text, required): The bucket to write to.
- Measurement (`measurement`, text, required): What the point measures, such as environment or power.
- Fields (`fields`, object, required): The values, by name, such as temperature 21.5 and door_open true. A value that reads as a number or true/false is written as one; wrap text in double quotes ("42") to keep it text.
- Tags (`tags`, object): Labels to find the point by later, such as room kitchen and sensor_id th-01. Values are always text.
- Time (`timestamp`, date and time): When it was measured: a date and time, or a Unix time. Leave blank for now.
- Whole numbers (`whole_numbers`, text): How to write whole numbers such as 23. Keep As decimals unless the field already holds integers in this bucket. One of: `float` (As decimals (23 is written as 23.0)), `integer` (As whole numbers (integers)). Default: `float`.

**Outputs**

- `bucket` (text): The bucket it was written to
- `fields` (object): Its fields, such as {"temperature": 21.5}
- `line` (text): The point as it was written, in line protocol
- `measurement` (text): The measurement, such as environment
- `tags` (object): Its tags, such as {"room": "kitchen"}
- `time` (text): The point's time, in UTC

**Example output**

```json
{
  "bucket": "sensors",
  "fields": {
    "humidity": 48,
    "temperature": 21.5
  },
  "line": "environment,room=kitchen,sensor_id=th-01 temperature=21.5,humidity=48.0 1777887000000000000",
  "measurement": "environment",
  "tags": {
    "room": "kitchen",
    "sensor_id": "th-01"
  },
  "time": "2026-05-04T09:30:00Z"
}
```

### Write line protocol

Write several data points at once as InfluxDB line protocol, one point a line, such as readings collected by another step.

**Inputs**

- Bucket (`bucket`, text, required): The bucket to write to.
- Lines (`lines`, text, required): One point a line, such as environment,room=kitchen temperature=21.5,humidity=48 1777887000. Lines starting with # are skipped.
- Time unit (`precision`, text): The unit of the times at the end of the lines. Defaults to nanoseconds. One of: `ns` (Nanoseconds), `us` (Microseconds), `ms` (Milliseconds), `s` (Seconds). Default: `ns`.

**Outputs**

- `bucket` (text): The bucket they were written to
- `points` (number): How many points (lines) were written
- `precision` (text): The unit of the lines' times: ns, us, ms or s

**Example output**

```json
{
  "bucket": "sensors",
  "points": 3,
  "precision": "s"
}
```
