Skip to main content

Mutations

Mutation actions modify records in your database. Use them to create related records, update values, or cascade deletions. Open any automation in Automation from the top navigation and click Add Condition, Record or Action to add a mutation.

Operation types

OperationDescription
CreateInsert a new record into a collection
UpdateModify existing records matching conditions
DeleteRemove records matching conditions

Configuration

FieldRequiredDescription
OperationYesCreate, Update, or Delete
CollectionYesTarget collection to modify
Field MappingsFor Create/UpdateMap values to collection fields
ConditionsFor Update/DeleteFilter which records to affect

Create operation

Insert a new record with specified field values.

Field mapping

Map source values to target fields. Click the + icon next to value inputs to select available fields and variables.

Target fieldSource value
customerId{{order.customerId}}
orderId{{order.id}}
statuspending
createdAt{{order.createdAt}}

Example: Create audit log

Trigger: When order created (alias: order)

Action: Mutation (Create)
Collection: AuditLogs
Fields:
- action = "order_created"
- recordId = {{order.id}}
- userId = {{order.userId}}

Update operation

Modify existing records that match your conditions.

Conditions

Specify which records to update:

FieldOperatorValue
id={{user.managerId}}

Field mapping

Set new values for the matching records.

Trigger: When employee created (alias: employee)

Action: Mutation (Update)
Collection: Departments
Conditions:
- id = {{employee.departmentId}}
Fields:
- employeeCount = {{department.employeeCount}} + 1

Delete operation

Remove records matching your conditions.

Example: Cascade delete

Trigger: When user deleted (alias: user)

Action: Mutation (Delete)
Collection: UserSessions
Conditions:
- userId = {{user.id}}

Field types in mappings

SourceSyntaxExample
Trigger data{{triggerAlias.field}}{{order.customerId}}
Record query{{recordAlias.field}}{{manager.email}}
Variable{{variableName}}{{calculatedTotal}}
Static valueDirect value"pending"

Use cases

  • Audit trails — Create log entries when records change
  • Auto-assign — Set default values on new records
  • Cascade updates — Update related records when parent changes
  • Data sync — Keep denormalized data in sync
  • Cleanup — Delete orphaned records

Best practices

  • Use conditions carefully — Avoid unintended bulk updates
  • Test with a single record — Verify behavior before processing many records
  • Consider execution phase — "Before" mutations affect the triggering operation
  • Log before mutating — Add a Logger action to verify values during development