Skip to main content
Data operation actions allow you to interact with databases in your workflows. These actions support SQL databases (PostgreSQL, MySQL, SQLite) and MongoDB through configured integrations.
Before using data operations, ensure you have a database integration configured. See Configuration Reference for setup details.

fetch

Retrieves data from a database table using filters.

Integration ID

The database integration to query against.
YAML KeyintegrationID
Typestring
RequiredYes

Table

The database table or collection name to query.
YAML Keytable
Typestring
RequiredYes

Filters

Query filters to narrow down results. See Filter Syntax for available operators.
YAML Keyfilters
Typearray
RequiredNo

Single

Return a single result object instead of an array.
YAML Keysingle
Typeboolean
RequiredNo
Defaultfalse

Fail If Empty

Treat no results as a failure, routing to the fail step.
YAML KeyfailIfEmpty
Typeboolean
RequiredNo
Defaulttrue

Example

actions:
  get_user:
    type: fetch
    config:
      integrationID: my_database
      table: users
      filters:
        - field: email
          operator: eq
          value: "{{ param \"email\" }}"
      single: true
      failIfEmpty: true
    next: response.success
    fail: response.not_found

store

Stores a new record in a database table.

Integration ID

The database integration to store data in.
YAML KeyintegrationID
Typestring
RequiredYes

Table

The database table or collection name to insert into.
YAML Keytable
Typestring
RequiredYes

Fields

Data fields to store as key-value pairs.
YAML Keyfields
Typemap
RequiredYes

Datasource Options

Additional datasource-specific options.
YAML KeydatasourceOptions
Typemap
RequiredNo

Example

actions:
  create_user:
    type: store
    config:
      integrationID: my_database
      table: users
      fields:
        email: "{{ param \"email\" }}"
        name: "{{ param \"name\" }}"
        password: "{{ .hash_password }}"
        created_at: "{{ now }}"
    next: response.created
    fail: response.error
If no id field is provided, a UUID will be automatically generated.

update

Updates existing records in a database table.

Integration ID

The database integration containing the records.
YAML KeyintegrationID
Typestring
RequiredYes

Table

The database table or collection name to update.
YAML Keytable
Typestring
RequiredYes

Filters

Filters to identify which records to update. See Filter Syntax for available operators.
YAML Keyfilters
Typearray
RequiredYes

Fields

Fields to update with their new values.
YAML Keyfields
Typemap
RequiredYes

Datasource Options

Additional datasource-specific options.
YAML KeydatasourceOptions
Typemap
RequiredNo

Example

actions:
  update_user:
    type: update
    config:
      integrationID: my_database
      table: users
      filters:
        - field: id
          operator: eq
          value: "{{ param \"user_id\" }}"
      fields:
        name: "{{ param \"name\" }}"
        updated_at: "{{ now }}"
    next: response.success
    fail: response.error

delete

Deletes records from a database table.

Integration ID

The database integration containing the records.
YAML KeyintegrationID
Typestring
RequiredYes

Table

The database table or collection name to delete from.
YAML Keytable
Typestring
RequiredYes

Filters

Filters to identify which records to delete. See Filter Syntax for available operators.
YAML Keyfilters
Typearray
RequiredYes

Datasource Options

Additional datasource-specific options.
YAML KeydatasourceOptions
Typemap
RequiredNo

Example

actions:
  delete_user:
    type: delete
    config:
      integrationID: my_database
      table: users
      filters:
        - field: id
          operator: eq
          value: "{{ param \"user_id\" }}"
    next: response.success
    fail: response.error

mongoquery

Executes native MongoDB queries with filter and projection support.

Integration ID

The MongoDB integration to query against.
YAML KeyintegrationID
Typestring
RequiredYes

Collection

The MongoDB collection name to query.
YAML Keycollection
Typestring
RequiredYes

Filter Query

MongoDB filter query in JSON format.
YAML KeyfilterQuery
Typestring
RequiredYes

Projection

MongoDB projection query in JSON format to select specific fields.
YAML Keyprojection
Typestring
RequiredNo

Fail If Empty

Treat no results as a failure, routing to the fail step.
YAML KeyfailIfEmpty
Typeboolean
RequiredNo
Defaulttrue

Example

actions:
  query_users:
    type: mongoquery
    config:
      integrationID: my_mongodb
      collection: users
      filterQuery: '{"status": "active", "age": {"$gte": 18}}'
      projection: '{"name": 1, "email": 1, "_id": 0}'
      failIfEmpty: false
    next: response.success
Dynamic filter example:
actions:
  search_users:
    type: mongoquery
    config:
      integrationID: my_mongodb
      collection: users
      filterQuery: '{"email": "{{ param "email" | stringescape }}"}'
    next: response.success
Use the stringescape template function when inserting user input into JSON queries to prevent injection attacks.

Filter Syntax

The fetch, update, and delete actions use a common filter syntax:
filters:
  - field: field_name
    operator: eq
    value: "comparison_value"

Available Operators

OperatorDescription
eqEqual to
neNot equal to
gtGreater than
gteGreater than or equal
ltLess than
lteLess than or equal
inValue in array
ninValue not in array

Multiple Filters Example

filters:
  - field: status
    operator: eq
    value: active
  - field: age
    operator: gte
    value: "18"
  - field: role
    operator: in
    value:
      - admin
      - moderator

Next Steps

Actions Overview

Learn about action structure and chaining.

Vector Operations

Store and query vector embeddings.

Authentication

Secure your APIs with JWT and authentication.

Secrets Management

Securely store database credentials.