Skip to content

Workflow Patterns

These reusable patterns cover the most common scenarios. Use them as starting points and adapt to your specific requirements.

Pattern 1 — Webhook-Triggered Object Processing

When to use: React to a CRM event and perform one or more actions — notify an external system, call an external API, enrich the record, create a related record in Lime, or run AI on the data.

Flow:

Lime CRM Trigger → [process/transform] → [action]

Steps: 1. Add a Lime CRM Trigger node. Set the Limetype and event(s) to listen for. 2. Add transform or condition nodes as needed. All field values are available directly in $json.body.body.values. 3. Add the action node (HTTP Request to external API, etc.).

If your action requires data from a related record (for example, the company linked to a deal), add a getSingleObject step to fetch it:

Lime CRM Trigger → getSingleObject (related record) → [process] → [action]

Key configuration: - Use {{ $json.body.body.values.fieldName }} to access current field values. - Use {{ $json.body.body.original_values.fieldName }} to access the previous value of a changed field (present on update events only). - If using getSingleObject, set onError: continueErrorOutput so a missing record does not silently fail.


Pattern 2 — Scheduled Data Sync

When to use: Periodically export CRM data to an external system, or import updated data from an external source into Lime CRM.

Flow:

Schedule Trigger → getManyObjects (with date filter) → [transform] → External API

Steps: 1. Add a Schedule Trigger node. Set the interval (hourly, nightly, etc.). 2. Add a Lime CRM getManyObjects node. Filter by _timestamp to only fetch records changed since the last run:

{
  "key": "_timestamp",
  "op": ">",
  "exp": "{{ $now.minus(1, 'hour').toISO() }}"
}
3. Transform and map the data as needed. 4. Send to the external system using an HTTP Request node (or the relevant integration node).

Key configuration: - Set an explicit limit on getManyObjects. Monitor actual volumes and increase if needed. - Log the sync result (record count, any errors) to a history or monitoring Limetype in CRM. - The expression $now.minus(1, 'hour') assumes the workflow runs reliably on schedule. For critical syncs, store the last successful run timestamp in a monitoring Limetype and use that as the filter value — this ensures no records are missed if the workflow is delayed or fails.


Pattern 3 — Individual Object Upsert

When to use: Create or update a CRM record based on a unique identifier (for example, an organisation number or email address), when business logic must fire (Python, Lime Automations, or webhooks). Do not use bulk operations in this case.

Flow:

getManyObjects (find by unique field) → IF (exists?) → updateSingleObject / createSingleObject

Steps: 1. Add a Lime CRM getManyObjects node. Filter by the unique field:

{
  "key": "orgnumber",
  "op": "=",
  "exp": "{{ $json.orgnumber }}"
}
Set limit: 2 — fetching two results lets you detect unexpected duplicates rather than silently picking the first match. 2. Add an IF node. Condition: {{ $json.length > 1 }}. If true, more than one record matched — this is a data quality issue that should not be resolved automatically. Route to an alert or error handler. 3. On the false branch, add a second IF node. Condition: {{ $json.length === 1 }}. 4. On the true branch: updateSingleObject with {{ $json[0]._id }}. 5. On the false branch (no match found): createSingleObject.

Why not bulk? Bulk operations bypass Python logic, Lime Automations, and webhooks. If any of these need to fire, use this pattern instead.


Pattern 4 — Data Round-Trip (Enrich CRM from External API)

When to use: Call an external API with data from a CRM record and write the result back — for example, a credit check, address lookup, or company data enrichment.

Flow:

# When all needed data is in the trigger payload:
Lime CRM Trigger → HTTP Request (external API) → updateSingleObject

# When you need data from a related record:
Lime CRM Trigger → getSingleObject (related record) → HTTP Request (external API) → updateSingleObject

Steps: 1. Trigger on the event that should initiate enrichment (for example, company created). 2. If you need data from a related record, fetch it with getSingleObject (for example, the company linked to a deal). The trigger payload already includes all field values of the triggered record — skip this step if you have everything you need. 3. Call the external API using the identifier it expects (for example, organisation number or email address). 4. Map the external response to CRM fields and call updateSingleObject on the record to enrich.

Key configuration: - Add error handling around the external API call. A 404 or empty response means no match was found — route it to a log or skip rather than crashing the workflow. - If the external API is rate-limited or unreliable, add a Wait node and retry branch before the error handler.


Pattern 5 — Sync from External System

When to use: An external system (for example an ERP or e-commerce platform) is the master for certain data, and changes there need to be reflected in Lime CRM. This can be triggered either by an inbound webhook from the external system, or by a scheduled job that polls it.

Variant A — Inbound Webhook from External System

The external system calls the workflow tool's webhook URL when a record changes.

Flow:

Webhook Trigger (from external system) → upsert in Lime CRM

Steps: 1. Add a trigger node for an external source, if one exists; otherwise, use the Webhook trigger node 2. Map the incoming payload to Lime CRM fields. 3. Use the individual upsert pattern (Pattern 3) to create or update the record in Lime CRM.

Key configuration: - Use a unique identifier from the external system (for example the ERP's company ID) as the matchingProperty in the upsert lookup. - Validate the inbound payload before writing to Lime CRM — external systems may send unexpected data formats.

Variant B — Scheduled Poll from External System

When the external system cannot push events, poll it on a schedule.

Flow:

Schedule Trigger → HTTP Request (external API) → Loop Over Items → upsert in Lime CRM

Steps: 1. Add a Schedule Trigger node. Set the interval appropriate to how fresh the data needs to be. 2. Fetch changed records from the external API using an HTTP Request node. Use a timestamp or cursor to fetch only records changed since the last run. 3. Loop over the results and upsert each record into Lime CRM using Pattern 3.

Key configuration: - Store the last successful sync timestamp (for example in a monitoring Limetype in Lime CRM) to use as the cursor on the next run. - Log the number of records synced and any failures.


Pattern 6 — Bulk Data Migration

When to use: Import or migrate large datasets (hundreds to thousands of records) where no Python logic, Lime Automations, or webhooks need to fire.

Flow:

Read Data (file/API) → [transform] → bulkCreateOrUpdateManyObjects

Steps: 1. Read source data from a file (CSV, Excel) or external API. 2. Transform and map to the target Limetype's properties. 3. Add a Lime CRM bulkCreateOrUpdateManyObjects node. - Set matchingProperty to a unique field (for example orgnumber or email). - The node auto-batches in chunks of 200 records. 4. After the bulk node, check {{ $json.summary.failed }} and route failures to an alert.

Prerequisites: - Bulk operations must be activated on the CRM instance. Contact Lime support or your instance administrator. - Bulk operations skip all business logic — confirm this is acceptable before using.

Handling partial failures:

{{ $json.summary.failed > 0 }}
// → true: route to alerting/logging step with jobId and summary

Choosing the Right Pattern

Scenario Pattern
React to a CRM event Pattern 1 — Webhook-triggered processing
Nightly or hourly sync Pattern 2 — Scheduled sync
Create or update by unique key, logic must fire Pattern 3 — Individual upsert
Enrich CRM from external API Pattern 4 — Data round-trip
Sync data from an external system into Lime CRM Pattern 5 — Sync from external system
Migrate 100+ records, no logic needed Pattern 6 — Bulk migration