activepieces-4-branching-and-conditional-logic
Sub-skill of activepieces: 4. Branching and Conditional Logic.
Best use case
activepieces-4-branching-and-conditional-logic is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Sub-skill of activepieces: 4. Branching and Conditional Logic.
Teams using activepieces-4-branching-and-conditional-logic should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/4-branching-and-conditional-logic/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How activepieces-4-branching-and-conditional-logic Compares
| Feature / Agent | activepieces-4-branching-and-conditional-logic | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Sub-skill of activepieces: 4. Branching and Conditional Logic.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# 4. Branching and Conditional Logic
## 4. Branching and Conditional Logic
```typescript
// Branch step with multiple conditions
const branchingFlow = {
"displayName": "Lead Qualification Flow",
"trigger": {
"name": "webhook",
"type": "WEBHOOK",
"settings": {},
"displayName": "New Lead"
},
"steps": [
{
"name": "enrich_lead",
"type": "PIECE",
"settings": {
"pieceName": "@activepieces/piece-clearbit",
"pieceVersion": "~0.2.0",
"actionName": "enrich_company",
"input": {
"domain": "{{trigger.body.company_domain}}"
}
},
"displayName": "Enrich Lead Data"
},
{
"name": "calculate_score",
"type": "CODE",
"settings": {
"input": {
"lead": "{{trigger.body}}",
"enriched": "{{enrich_lead}}"
},
"sourceCode": {
"code": `
export const code = async (inputs) => {
const { lead, enriched } = inputs;
let score = 0;
// Company size scoring
if (enriched.metrics?.employees > 1000) score += 30;
else if (enriched.metrics?.employees > 100) score += 20;
else if (enriched.metrics?.employees > 10) score += 10;
// Industry scoring
const highValueIndustries = ['technology', 'finance', 'healthcare'];
if (highValueIndustries.includes(enriched.category?.industry?.toLowerCase())) {
score += 25;
}
// Title scoring
const seniorTitles = ['ceo', 'cto', 'vp', 'director', 'head'];
if (seniorTitles.some(t => lead.title?.toLowerCase().includes(t))) {
score += 20;
}
// Budget scoring
if (lead.budget > 100000) score += 25;
else if (lead.budget > 50000) score += 15;
else if (lead.budget > 10000) score += 10;
return {
score,
tier: score >= 70 ? 'hot' : score >= 40 ? 'warm' : 'cold',
lead: { ...lead, enriched }
};
};`
}
},
"displayName": "Calculate Lead Score"
},
{
"name": "route_by_tier",
"type": "BRANCH",
"settings": {
"conditions": [
{
"name": "hot_lead",
"expression": {
"type": "EXPRESSION",
"value": "{{calculate_score.tier}} === 'hot'"
},
"steps": [
{
"name": "notify_sales_urgent",
"type": "PIECE",
"settings": {
"pieceName": "@activepieces/piece-slack",
"actionName": "send_message",
"input": {
"channel": "#hot-leads",
"text": "HOT LEAD: {{calculate_score.lead.name}} from {{calculate_score.lead.company}} (Score: {{calculate_score.score}})"
}
}
},
{
"name": "create_salesforce_lead",
"type": "PIECE",
"settings": {
"pieceName": "@activepieces/piece-salesforce",
"actionName": "create_record",
"input": {
"objectName": "Lead",
"fields": {
"FirstName": "{{calculate_score.lead.first_name}}",
"LastName": "{{calculate_score.lead.last_name}}",
"Company": "{{calculate_score.lead.company}}",
"Email": "{{calculate_score.lead.email}}",
"LeadSource": "Website",
"Rating": "Hot"
}
}
}
},
{
"name": "schedule_demo",
"type": "PIECE",
"settings": {
"pieceName": "@activepieces/piece-calendly",
"actionName": "create_scheduling_link",
"input": {
"event_type": "sales-demo",
"invitee_email": "{{calculate_score.lead.email}}"
}
}
}
]
},
{
"name": "warm_lead",
"expression": {
"type": "EXPRESSION",
"value": "{{calculate_score.tier}} === 'warm'"
},
"steps": [
{
"name": "add_to_nurture",
"type": "PIECE",
"settings": {
"pieceName": "@activepieces/piece-mailchimp",
"actionName": "add_subscriber",
"input": {
"list_id": "{{connections.mailchimp.nurture_list_id}}",
"email": "{{calculate_score.lead.email}}",
"tags": ["warm-lead", "nurture-sequence"]
}
}
}
]
},
{
"name": "cold_lead",
"expression": {
"type": "EXPRESSION",
"value": "{{calculate_score.tier}} === 'cold'"
},
"steps": [
{
"name": "add_to_drip",
"type": "PIECE",
"settings": {
"pieceName": "@activepieces/piece-mailchimp",
"actionName": "add_subscriber",
"input": {
"list_id": "{{connections.mailchimp.general_list_id}}",
"email": "{{calculate_score.lead.email}}",
"tags": ["cold-lead"]
}
}
}
]
}
]
},
"displayName": "Route by Lead Tier"
}
]
};
```Related Skills
improve-decision-logic-scoring
Sub-skill of improve: Decision Logic (Scoring).
clinical-trial-protocol-full-workflow-logic
Sub-skill of clinical-trial-protocol: Full Workflow Logic.
n8n-4-conditional-branching-and-error-handling
Sub-skill of n8n: 4. Conditional Branching and Error Handling.
activepieces-integration-with-notion-and-slack
Sub-skill of activepieces: Integration with Notion and Slack.
activepieces-8-error-handling-and-retry-logic
Sub-skill of activepieces: 8. Error Handling and Retry Logic.
activepieces-7-approval-flows
Sub-skill of activepieces: 7. Approval Flows.
activepieces-6-custom-piece-development
Sub-skill of activepieces: 6. Custom Piece Development.
activepieces-5-loop-and-iteration
Sub-skill of activepieces: 5. Loop and Iteration.
activepieces-3-scheduled-flows
Sub-skill of activepieces: 3. Scheduled Flows.
activepieces-2-webhook-triggers
Sub-skill of activepieces: 2. Webhook Triggers.
activepieces-1-flow-organization
Sub-skill of activepieces: 1. Flow Organization (+3).
activepieces-1-basic-flow-structure
Sub-skill of activepieces: 1. Basic Flow Structure.