Skip to main content
Well-designed automations are reliable, efficient, and easy to maintain. This guide covers foundational design principles, performance optimization strategies, common patterns, and troubleshooting techniques to help you get the most out of Elementum’s Automation System.

Design Principles

Event-Driven Thinking

Design automations around events rather than tasks:
  • Think: “What event should trigger this process?”
  • Not: “What tasks do I need to automate?”
For example, instead of “automate invoice processing,” think “when an invoice attachment is added to a vendor record, extract the data, validate it, and route for approval.”

Strategic AI Usage

Use AI actions where they add the most value:
  • Information categorization - Classify incoming data into predefined groups
  • Content analysis - Summarize or extract key details from unstructured text
  • Decision-making based on data - Route workflows based on AI-assessed criteria
  • Transforming unstructured data - Normalize inconsistent formats into structured fields
Avoid using AI actions for tasks that can be handled by deterministic logic like IF conditions or calculations.

Maintainable Automations

  • Clear names - Use descriptive automation and variable names that explain their purpose
  • Document logic - Add comments for complex conditions so others can understand the reasoning
  • Plan for failures - Account for external API failures and missing data scenarios
  • Write defensive scripts - When using Execute Script, always provide fallback default values for inputs, handle data parsing errors gracefully, and make sure the script returns all expected output fields on every path — including error paths — so downstream actions don’t fail on missing data
  • Test with real data - Verify all automation paths using actual business data, including edge cases and error conditions

Building Faster Automations

Performance optimization is most relevant when immediate action is needed after an automation is triggered, such as real-time user-facing updates or time-sensitive workflows. For background processes where a few extra seconds don’t matter, prioritize clarity and maintainability over raw speed.

Minimize Record Interactions

Updating fields on a record is one of the more time-consuming operations in an automation. Each interaction with the record adds latency, so reducing these touchpoints has a significant impact on overall speed.
  • Batch field updates - Instead of updating fields one at a time across multiple actions, consolidate all field changes into a single Update Record Fields action at the end of your automation.
  • Use variables for intermediate data - Store temporary values in variables rather than writing them to the record. Variables are held in memory during execution and are much faster to read and write.
  • Touch the record once - Structure your automation so it reads from the record at the beginning and writes back once at the end. This “read once, write once” pattern eliminates unnecessary round trips.

Consolidate Logic into Execute Script

Every action in an automation carries overhead. Chaining several Set Variable, Run Calculation, and other actions to implement what is fundamentally one logical step adds latency and makes the workflow harder to follow.
  • Replace action chains with Execute Script - If you have a sequence of Set Variable and Run Calculation actions with no platform operations between them, collapse them into a single Execute Script action. The script can parse inputs, validate fields, compute values, and return all results at once. This is typically the highest-impact optimization you can make.
  • Know when to split scripts - Use separate scripts when a platform action (Send API Request, Search Records, AI Search) must happen between two blocks of logic, or when a single script would exceed roughly 200 lines and the halves are conceptually distinct.
  • Avoid separate create and update actions - If you need to create a record and then immediately update it, set all the necessary field values in the Create Record action itself.
  • Reduce loop iterations - Each line item processed adds time, especially if the loop body includes external calls to Snowflake or APIs. Filter or limit the scope of your data before entering a Repeat for Each loop.

Choose the Right Search Strategy

Not all search actions are interchangeable. Choosing the right one depends on the type of input.
  • AI Search for natural language input - When the search input comes from a user or contains free-text descriptions, use AI Search. It handles synonyms, partial matches, and variations that exact filters would miss. For example, a user searching for “lab gloves” will match “Laboratory Nitrile Gloves” through semantic matching.
  • Search Records for system keys - When looking up a record by a machine-generated identifier like a record ID, tracking code, or system-assigned key, use Search Records with an exact-match filter. These values have a guaranteed format and don’t benefit from semantic matching.

Design for Efficiency

Structure your automation logic to avoid unnecessary work.
  • Validate early and gate with Switch - Place a validation step as the first action after the trigger. Check all required fields, formats, and business rules up front, then use a Switch action to route valid inputs to the main workflow and invalid inputs to an error output. This prevents expensive operations like API calls or record creation from running on bad data.
  • Design automations as composable functions - Break complex workflows into smaller, focused automations with On-Demand Triggers, and call them from other automations using Run Automation. When the same logic appears in multiple automations (e.g., calling an external API and parsing its response), extracting it into a shared automation means fixing bugs or updating integrations in one place.
  • Use async handoffs for slow external calls - If an automation makes a slow external API call (several seconds or more), consider splitting it into two automations: one that validates the input and creates a tracking record immediately, and a second that triggers on the record creation to handle the slow call in the background. The first automation returns quickly while the second processes asynchronously.

Common Patterns

Create connected automations for complete customer processes:
Lead Created → Qualification → Proposal → Contract → Onboarding → Support → Renewal
Combine AI decision-making with human approval:
Request Created → AI Classification → Route to Appropriate Approver → Decision → Notification → Next Steps
Chain multiple data processing steps:
Data Received → AI Analysis → Transform Data → Validation → Storage → Notification
Monitor conditions and escalate appropriately:
Condition Met → Assessment → IF Critical → Immediate Alert OTHERWISE → Standard Notification

Advanced Implementation

Automation Chaining

Building on the composable design approach, you can chain automations in sequence — where one automation’s output feeds the next as input — to orchestrate multi-step workflows that span different teams or systems.

Complex Variable Structures

Beyond using variables for intermediate data storage, you can use Set Variable to build more complex data structures that evolve throughout your automation — aggregating results from loops, assembling payloads for API calls, or constructing dynamic content from multiple sources.

Conditional Logic Trees

Build complex decision trees using nested IF conditions with AND/OR operators for nuanced routing scenarios that go beyond simple branching.

Structured Outputs from Execute Script

Execute Script returns its result as a single text value. To break that result into individual fields that downstream actions and automation outputs can reference, follow this pattern:
  1. Execute Script returns a structured result (e.g., a success flag, a request number, and an error message)
  2. File Reader (JSON mode) parses the result into individual fields
  3. Set Variable actions create named values from the parsed fields for use as workflow outputs
Using Set Variable references in your published outputs creates a stable output contract. If you later change the script’s internal logic, the output names and structure stay the same for any callers.

Integration Patterns

Coordinate across multiple external systems within a single automation. Use Send API Request actions to call services sequentially, storing each response in variables for use in subsequent calls. When calling external APIs, enable Continue on Error on the Send API Request action and add an Execute Script immediately after it. Pass the response status and body into the script so it can determine whether the call succeeded and extract a meaningful error message if it didn’t. This prevents a single failed API call from stopping the entire workflow and gives downstream actions useful information about what went wrong.

Troubleshooting

  • Automation is published (not draft)
  • Testing with correct event type
  • Record/data meets trigger conditions
  • Correct variable names being used
  • Previous action completed successfully
  • Accessing correct variable structure level
  • Input data is in expected format
  • Sufficient context provided
  • AI action receiving correct variables
  • Search scope is appropriate
  • Number of separate automations
  • Data processing efficiency
  • Whether field updates can be consolidated (see Building Faster Automations)

For complete action details and examples, see the Automation Actions Reference. For trigger configuration and use cases, see the Automation Triggers Reference.