Skip to content

59. Conditions - warunki logiczne w workflows

Poziom: Średni | Czas: 10 min

Conditions (warunki) pozwalają stworzyć inteligentne workflows, które reagują różnie w zależności od danych kontaktu. Zamiast "jedna ścieżka dla wszystkich", tworzysz personalizowane doświadczenia.

Podstawy If/Then Logic

Prosty warunek:

IF: {{budget}} > $5,000
THEN: Send premium offer email
ELSE: Send standard offer email

Wizualnie w GHL:

[1] Tag "interested" added (TRIGGER)

[2] IF/ELSE Condition
    ├─ IF: Custom field "Budget" > $5,000
    │   ├─ [3] Assign to senior sales rep
    │   ├─ [4] Send "Premium Package" email
    │   └─ [5] Create high-value opportunity

    └─ ELSE: Budget ≤ $5,000
        ├─ [6] Assign round robin
        ├─ [7] Send "Standard Package" email
        └─ [8] Add to nurture campaign

Typy Warunków

1. Field-Based Conditions

Text fields:

IF: {{firstName}} is not empty
IF: {{email}} contains "@gmail.com"
IF: {{company}} equals "Microsoft"
IF: {{jobTitle}} contains "founder" OR "CEO"

Number fields:

IF: {{leadScore}} > 70
IF: {{budget}} >= 5000 AND {{budget}} <= 10000
IF: {{age}} < 35

Date fields:

IF: {{lastContactDate}} was more than 30 days ago
IF: {{contractEndDate}} is within next 30 days
IF: {{birthday}} is today

2. Tag-Based Conditions

IF: Has tag "vip-customer"
IF: Does NOT have tag "purchased"
IF: Has any of tags: "hot-lead", "demo-requested"
IF: Has all tags: "interested" AND "budget-confirmed"

Example:

IF: Has tag "trial-user" AND does NOT have tag "purchased"
THEN: Send upgrade offer
ELSE: Do nothing (already customer or not in trial)

3. Pipeline/Stage Conditions

IF: Opportunity stage = "Proposal Sent"
IF: Opportunity is in pipeline "Sales"
IF: Deal value > $1,000
IF: Days in current stage > 7 (stuck!)

Example: Stuck deal alert

Workflow runs daily:

IF: Opportunity stage = "Proposal Sent" 
    AND days in stage > 5
THEN:
  - Send notification to manager
  - Create task "Follow up on stuck proposal"
  - Send client "Questions?" email

4. Activity-Based Conditions

IF: Email "Offer" was opened
IF: Link "pricing-page" was clicked
IF: SMS reply received
IF: Appointment was booked
IF: Last activity was more than 14 days ago

Example: Engagement-based routing

Send Email "Product Demo Invite"

Wait 24 hours

IF: Email opened
  THEN:
    - Send follow-up: "Ready to see demo?"
    - Tag "engaged"
ELSE: Email NOT opened
  THEN:
    - Send SMS: "Missed our email? Demo link: {{url}}"
    - Tag "needs-sms-outreach"

5. Time-Based Conditions

IF: Current time is between 9 AM - 5 PM (business hours)
IF: Today is Monday, Wednesday, or Friday
IF: Days since contact created > 30
IF: Time until appointment < 24 hours

Example: Smart send timing

Action: Send SMS reminder

Condition:
IF: Current time between 9 AM - 8 PM (contact's timezone)
  THEN: Send now
ELSE:
  THEN: Wait until tomorrow 9 AM, then send

6. Workflow History Conditions

IF: Contact has completed workflow "Onboarding"
IF: Contact is currently in workflow "Trial Nurture"
IF: Contact exited workflow "Sales" with status "Purchased"

7. Multi-Condition Logic

AND (all must be true):

IF: {{budget}} > $5,000
    AND has tag "decision-maker"
    AND {{email}} does NOT contain "@gmail.com"
    AND last activity < 7 days ago
THEN:
    → High-priority lead! Assign to CEO.

OR (any can be true):

IF: Has tag "hot-lead"
    OR email opened 3+ times
    OR clicked "pricing-page" link
    OR form "demo-request" submitted
THEN:
    → Engaged prospect, accelerate sales process

Combined (AND + OR):

IF: (Has tag "trial-user" OR has tag "demo-attended")
    AND days since created > 14
    AND does NOT have tag "purchased"
THEN:
    → Trial ending soon, send upgrade offer

Advanced Condition Examples

Example 1: Lead Scoring Logic

[1] Form submitted (TRIGGER)

[2] Set {{leadScore}} = 0

[3] IF: Job title contains "founder", "CEO", "director"
    THEN: {{leadScore}} = {{leadScore}} + 20

[4] IF: Company size > 50 employees
    THEN: {{leadScore}} = {{leadScore}} + 15

[5] IF: Budget > $10,000
    THEN: {{leadScore}} = {{leadScore}} + 25

[6] IF: Email domain is corporate (NOT @gmail/@yahoo)
    THEN: {{leadScore}} = {{leadScore}} + 10

[7] IF: {{leadScore}} > 50
    THEN:
      - Tag "high-value-lead"
      - Assign to senior rep
      - Send premium offer
    ELSE IF: {{leadScore}} 25-50
    THEN:
      - Tag "medium-value-lead"
      - Assign round robin
      - Send standard offer
    ELSE: leadScore < 25
    THEN:
      - Tag "low-value-lead"
      - Add to long-term nurture

Example 2: Smart Appointment Reminders

[1] Appointment booked (TRIGGER)

[2] IF: Appointment date > 7 days away
    THEN:
      - Wait until 7 days before → Send email reminder
      - Wait until 24h before → Send SMS reminder
      - Wait until 1h before → Send final SMS
    ELSE IF: Appointment date 1-7 days away
    THEN:
      - Wait until 24h before → Send SMS
      - Wait until 1h before → Send final SMS
    ELSE: Appointment < 24h away
    THEN:
      - Immediately send SMS: "Appointment soon!"
      - Wait until 1h before → Final reminder

Example 3: Re-Engagement Based on Inactivity

[1] Daily workflow runs for all contacts (TIME TRIGGER)

[2] Filter: Contacts with tag "active-customer"

[3] IF: Last activity > 30 days ago
    THEN:
      - Send Email: "We miss you! Here's 20% OFF"
      - Tag "inactive-30d"

[4] Wait 7 days

[5] IF: Still no activity (last activity > 37 days)
    THEN:
      - Send SMS: "Are you still with us?"
      - Create task: "Call inactive customer"
      - Tag "at-risk"

[6] Wait 14 days

[7] IF: Still no activity (last activity > 51 days)
    THEN:
      - Send "Exit survey" email
      - Assign to retention team
      - Tag "churning"

Example 4: Product Interest Routing

[1] Form "Product Interest" submitted (TRIGGER)

[2] IF: Selected "Coaching Package"
    THEN:
      - Assign to coaching team
      - Send "Coaching Info" email
      - Add to "Coaching Leads" campaign
      - Book coaching discovery call

[3] ELSE IF: Selected "Done-for-You Service"
    THEN:
      - Assign to DFY team
      - Send "DFY Info + Pricing" email
      - Create high-value opportunity
      - Schedule strategy session

[4] ELSE IF: Selected "DIY Course"
    THEN:
      - Send course sales page link
      - Add to "Course Nurture" campaign
      - Tag "self-service"

Condition Operators

Text operators:

- Equals
- Does not equal
- Contains
- Does not contain
- Starts with
- Ends with
- Is empty
- Is not empty

Number operators:

- Equals (=)
- Does not equal (≠)
- Greater than (>)
- Greater than or equal (≥)
- Less than (<)
- Less than or equal (≤)
- Between (range)

Date operators:

- Is (exact date)
- Before
- After
- Between
- Within next X days
- Within last X days
- More than X days ago
- Is today
- Is this week/month

Boolean operators:

- Is true
- Is false
- Is set (not empty)
- Is not set (empty)

Testing Conditions

Test different scenarios:

Scenario A: High-value lead
- Budget: $10,000
- Job title: "CEO"
- Expected: Assign to senior rep, premium email

Scenario B: Low-value lead  
- Budget: $1,000
- Job title: "Student"
- Expected: Add to nurture, educational content

Scenario C: Medium-value lead
- Budget: $5,000
- Job title: "Manager"
- Expected: Standard sales process

Run workflow in TEST MODE for each scenario
Verify correct paths taken

Common Mistakes

❌ Too many nested conditions (hard to manage)
✅ Keep it simple, max 2-3 levels deep

❌ Not handling ELSE case
✅ Always have fallback/default action

❌ Conflicting conditions
Example:
IF budget > $5,000 → Action A
IF budget > $3,000 → Action B
(Contact with $6k gets BOTH!)

✅ Use ELSE IF for mutually exclusive paths

❌ Forgetting timezone differences
✅ Use {{ contact.timezone}} for time-based conditions

❌ Testing with fake data only
✅ Test with real contact scenarios

Condition Checklist

Before publishing workflow:

☑ Conditions cover all possible cases?
☑ ELSE path defined (default fallback)?
☑ Tested with edge cases?
☑ No conflicting logic?
☑ Contact can't get stuck/lost?
☑ Clear naming (condition purpose obvious)?
☑ Timezone consideration for time-based conditions?

Następny krok: 60. Wait Steps - czasy oczekiwania