1. Feature Overview
The Lead Workflow action template in Universal Data Sync (UDS) allows you to manage leads using advanced search. It searches for the lead based on the defined primary and secondary search criteria. It then performs the selected Action. This template helps you handle the dedup cases.
It supports two-level search logic using a primary and a secondary key, and based on the result, it performs the required lead operation—search, update, create, or capture—without requiring manual behavior selection.
Internally, this template can invoke 2 to 3 LeadSquared V2 API calls per execution. It is designed to simplify lead handling logic that would otherwise require multiple chained actions.
Note: Where this action should be used?
- Your lead volume is less as it consumes min 2 and max 3 v2 API calls internally.
- You want to handle dedupe cases basis any two unique lead fields within a single action.
2. Use Case
Use this template when:
- You want to avoid duplicate lead creation by checking two unique fields (e.g., Email + Phone)
- You want a single action to handle both existing and new leads
2.1 Logic Summary
Here’s how the Lead Workflow logic works:
- Search by Primary Key
- If not found → Search by Secondary Key
- If lead is found → Update the lead
- If lead is not found → Create a new lead
This flow ensures deduplication using two identifiers, and removes the need for manual branching.
3. Configure Lead Workflow Action
1. Select Template
Click +Action and select the Lead Workflow template from the available list.
2. Select Behavior
Choose a Behavior, which defines what action will be performed after the search:
Behavior | Description |
Lead Search | Retrieve lead details using primary and secondary keys. No changes are made. |
Lead Capture | If lead is found, update it. If not, create a new lead. |
Lead Create | Create a new lead if none exists. No update is performed. |
Lead Update | Update an existing lead if found; no lead is created. |

3. Configure Field Mapping
3.1 Set Search Keys
- Primary Search Key – Used as the first identifier to search for an existing lead (e.g., Email)
- Secondary Search Key – Used as a fallback if the primary key does not return a match (e.g., Phone)
If no lead is found with either key, a new lead is created. If a lead is found, the system updates it.
3.2 Map Lead Fields
Map all the fields you want to update or create in the lead record.
You can do that by selecting the desired Lead fields from the dropdown. Click on + icon, select Entity as Lead, and select the desired field from the dropdown.
This can include:
- Standard fields (e.g., First Name, Email, Phone)
- Custom fields
- Static values or formula-based transformations
4. Configure Response Mapping (Optional)
Capture and reuse response values such as: LeadId
, Status
, or Message
These can be passed to downstream actions or used in conditions or audits.
FAQs
1. What credentials are used?
All API calls are authenticated using the system user credential.
2. Do API limits apply?
Yes. Each execution may result in 2 to 3 internal API calls, counted against your:
- Daily V2 API quota
- 5-second burst rate limit
3. What if both keys fail to find a lead?
A new lead is created using the mapped fields.
4. Can I leave the secondary key blank?
Yes. The secondary key is optional. If only the primary is defined, only one search is attempted before a lead is created.
5. What if a lead is found?
The system updates the lead using the field mappings provided.
6. Are errors returned as-is?
Yes. All standard LeadSquared V2 API errors are returned directly. Refer to the V2 API Reference for definitions.
7. Is this template suitable for bulk sync?
This template is best suited for low to moderate volume data syncs, since each execution consumes multiple API calls.