Workflow Automation
Lotics workflows are declarative step sequences that chain tools, control flow, and expressions to automate business processes end-to-end. Instead of writing code, you define what should happen when a specific event occurs, and the workflow engine handles execution, retries, and state management. A single workflow can receive an email, extract data with AI, query and update records, generate documents, and send notifications, all without leaving the platform.
What are workflows?
A workflow in Lotics is a sequence of steps that executes automatically when a trigger condition is met. Each workflow has exactly one trigger and one or more steps. Steps run in order, and each step can reference data from the trigger event or from previous steps using expressions. Workflows are designed to replace the manual, repetitive processes that operations teams perform daily: copying data between systems, sending follow-up emails, updating spreadsheets, generating reports.
Workflows are declarative: you specify the trigger, define the steps, and configure each step's inputs. The workflow engine manages execution order, handles errors, and maintains state between steps. If a step fails, the workflow logs the error with full context so you can diagnose and fix the issue. There are no silent failures.
The AI assistant can build workflows from natural language descriptions. Describe what you want automated ("when a customer submits a booking request form, create a shipment record, assign it to the operations team, and send a confirmation email") and the assistant will create the workflow with the correct trigger, steps, and expressions.
Trigger types
Every workflow starts with a trigger, the event that causes the workflow to run. Lotics supports 9 trigger types that cover the most common ways work enters an operations team: data changes, incoming communications, scheduled tasks, user actions, and external system events.
Triggers are configured per-workflow and cannot be combined. If you need the same workflow to run on both a schedule and a record change, create two workflows that call a shared sequence of steps. Each trigger provides context data that subsequent steps can reference via expressions.
| Trigger | Fires when | Context provided |
|---|---|---|
| record_updated | A record is created, updated, or deleted in a specified table | The full record data, changed fields, and previous values |
| recurring_schedule | A cron expression matches (e.g., every weekday at 9am) | The scheduled execution time |
| receive_gmail_email | A new email arrives in a connected Gmail account | Sender, subject, body, attachments |
| receive_outlook_email | A new email arrives in a connected Outlook account | Sender, subject, body, attachments |
| button_pressed | A user clicks a button field in a table row | The record data from the row where the button was clicked |
| form_submitted | A public or internal form is submitted | All submitted field values |
| record_submit | A record is submitted for review via the submit action | The full record data and the submitting user |
| app_action | An action is triggered from within a chat-embedded app | The app context and action parameters |
| receive_webhook | An HTTP POST request is received at the workflow's webhook URL | The request body, headers, and query parameters |
Step types
Steps are the building blocks of a workflow. Each step performs a single action: calling a tool, evaluating a condition, iterating over a list, or pausing execution. Steps execute in sequence, and each step's output becomes available to subsequent steps through the expression engine.
Lotics provides 7 step types that cover the full range of automation needs, from simple tool calls to complex branching logic and asynchronous waiting patterns.
| Step type | Purpose | Example use |
|---|---|---|
| tool_call | Execute any registered tool (AI extraction, record operations, email sending, document generation, HTTP requests) | Extract invoice data from an attachment, create a record, send a Slack notification |
| if/else | Conditional branching based on an expression that evaluates to true or false | If invoice total exceeds $10,000, route to manager approval; otherwise, auto-approve |
| switch | Multi-way branching based on matching an expression against multiple cases | Route a support ticket to different teams based on category: billing, technical, shipping |
| foreach | Iterate over an array, executing nested steps for each item | For each line item in an invoice, create a separate record and validate against the PO |
| wait | Pause execution for a specified duration | Wait 24 hours after sending a payment reminder before escalating to collections |
| wait_for_event | Pause execution until a specific event occurs (e.g., a record status changes to 'approved') | Wait until a manager approves a purchase order before generating the payment |
| return | Exit the workflow early and return a result value | If a duplicate record is detected, return an error message and stop processing |
Expression engine
Expressions are the glue that connects steps together. Using the {{}} syntax, any step can reference data from the trigger event or from the output of previous steps. Expressions let you build dynamic workflows where each step adapts based on what happened before it.
For example, an email trigger provides {{trigger.subject}}, {{trigger.body}}, and {{trigger.attachments}}. If step 1 extracts an invoice number, step 2 can reference it as {{steps.step_1.output.invoice_number}}. Expressions support dot notation for nested objects, array indexing, and string interpolation.
The expression engine evaluates at runtime, so the same workflow definition works across different data. A workflow that processes invoices handles any invoice, regardless of the vendor, line item count, or currency. The expressions adapt to the actual data in each execution.
Example: freight forwarder booking confirmation
A freight forwarding company receives booking confirmations from shipping lines via email. Before Lotics, a coordinator would manually read each email, find the booking number, check the vessel name and ETA, open the tracking spreadsheet, update the record, and forward the information to the customer. This process took 10-15 minutes per booking and was error-prone.
With a Lotics workflow, the entire process is automated. The receive_gmail_email trigger fires when a booking confirmation arrives. A tool_call step uses AI to extract the booking number, vessel name, container number, and ETA from the email body. A second tool_call step queries the shipments table to find the matching record by booking number. A third tool_call step updates the record with the vessel, container, and ETA data.
An if/else step checks whether the ETA has changed from the previously recorded value. If it has, a tool_call step sends a notification to the operations team. Finally, a tool_call step generates a PDF confirmation document from a template and emails it to the customer. The entire process runs in under 30 seconds with no manual intervention.
Example: invoice processing and reconciliation
A logistics company receives hundreds of vendor invoices monthly via email. Each invoice needs to be recorded, cross-checked against the corresponding purchase order, and routed to the finance team for payment. Manual processing took the accounts payable team 3-4 days per month.
The workflow uses a receive_gmail_email trigger that filters for messages from known vendor domains. The first tool_call step uses AI to extract the vendor name, invoice number, date, line items, and total amount from the email attachment. A foreach step iterates over the extracted line items and creates a record for each one in the invoice details table.
A second tool_call step queries the purchase orders table to find the matching PO by vendor and PO number. An if/else step compares the invoice total against the PO amount. If the difference exceeds 2%, a tool_call step creates a discrepancy flag on the record and sends a notification to the finance manager with the details. If the amounts match, the invoice status is set to 'verified' automatically. The finance team now processes the same volume of invoices in half a day.