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.

TriggerFires whenContext provided
record_updatedA record is created, updated, or deleted in a specified tableThe full record data, changed fields, and previous values
recurring_scheduleA cron expression matches (e.g., every weekday at 9am)The scheduled execution time
receive_gmail_emailA new email arrives in a connected Gmail accountSender, subject, body, attachments
receive_outlook_emailA new email arrives in a connected Outlook accountSender, subject, body, attachments
button_pressedA user clicks a button field in a table rowThe record data from the row where the button was clicked
form_submittedA public or internal form is submittedAll submitted field values
record_submitA record is submitted for review via the submit actionThe full record data and the submitting user
app_actionAn action is triggered from within a chat-embedded appThe app context and action parameters
receive_webhookAn HTTP POST request is received at the workflow's webhook URLThe 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 typePurposeExample use
tool_callExecute 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/elseConditional branching based on an expression that evaluates to true or falseIf invoice total exceeds $10,000, route to manager approval; otherwise, auto-approve
switchMulti-way branching based on matching an expression against multiple casesRoute a support ticket to different teams based on category: billing, technical, shipping
foreachIterate over an array, executing nested steps for each itemFor each line item in an invoice, create a separate record and validate against the PO
waitPause execution for a specified durationWait 24 hours after sending a payment reminder before escalating to collections
wait_for_eventPause 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
returnExit the workflow early and return a result valueIf 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.

Frequently asked questions

There is no hard limit on the number of workflows. You can create as many as your operations require. Each workflow runs independently, and the engine handles concurrent executions across all active workflows.

The workflow stops at the failed step and logs the error with full context: the step type, input data, and error message. You can view the execution history, fix the issue, and re-run the workflow from the failed step. Errors are never silently swallowed.

Yes. Describe the process you want to automate in natural language, and the AI assistant will create the workflow with the appropriate trigger, steps, and expressions. You can then review and adjust the configuration before activating it.

Workflows do not directly call other workflows. If you need shared logic across multiple workflows, structure the steps within each workflow independently. This keeps each workflow self-contained and easier to debug.

Yes. Event-based triggers (record changes, emails, webhooks, button clicks, form submissions) fire within seconds of the event occurring. Scheduled triggers run at the configured cron time. Each step executes as soon as the previous step completes.