Fanbeam
Fanbeam
Documentation
API Reference
Getting Started
User Guides
Analytics
Automations
ActionsConditionsExecution HistoryQuick RulesTesting WorkflowsTrigger TypesVisual Workflow Builder
Collaboration
Media Management
Scheduling Posts
Settings
TypeScript SDK
User GuidesAutomations

Conditions

Add logic to your workflows with conditional branches

Conditions let you add decision points to your workflows. Based on the trigger data, conditions evaluate to Yes (match) or No (no match), allowing you to take different actions.

Condition Types

Text Contains

Check if the text includes specific keywords.

Configuration:

  • Field — What to check (comment text, author name, etc.)
  • Keywords — Words or phrases to look for
  • Case sensitive — Whether to match case (default: no)

Example:

Field: comment.text
Keywords: price, cost, how much
Case sensitive: No

Matches: "What's the PRICE?", "How much does it cost?", "pricing info?"


Text Matches Regex

Check text against a regular expression pattern.

Configuration:

  • Field — What to check
  • Pattern — Regular expression
  • Flags — Regex flags (i = case insensitive)

Example patterns:

PatternMatches
\bspam\b"spam" as a whole word
(buy|sell)\s+now"buy now", "sell now"
@\w+Any @mention
https?://URLs
\d{3}-\d{4}Phone numbers like 555-1234

Tip: Use regex101.com to test your patterns.


Author Filter

Filter based on the comment/message author.

Configuration:

  • Author IDs — List of user IDs to match
  • Author names — List of usernames to match
  • Mode — Include (allow only) or Exclude (block)

Use cases:

  • VIP list — Only respond to certain users
  • Block list — Ignore known spam accounts
  • Team filter — Different rules for team members

Text Length

Check the length of the text.

Configuration:

  • Field — What to check
  • Operator — Greater than, less than, equals
  • Value — Number of characters

Example:

Field: comment.text
Operator: Less than
Value: 5

Matches comments like "nice", "ok", "lol" (potential low-quality comments).


Expression (Advanced)

Combine multiple conditions with AND/OR logic.

Configuration:

  • Combinator — AND (all must match) or OR (any must match)
  • Rules — List of individual conditions

Example AND:

Combinator: AND
Rules:
  - comment.text contains "price"
  - comment.authorName not in ["bot_account", "spam_user"]

Matches: Comments asking about price, excluding known bot accounts.

Example OR:

Combinator: OR
Rules:
  - comment.text contains "spam"
  - comment.text matches regex "DM me|check.*bio"

Matches: Comments containing "spam" OR matching the spam regex pattern.

Condition Outputs

All conditions have two outputs:

  • Yes (true) — The condition matched
  • No (false) — The condition didn't match

You can connect actions to either output:

[Comment Received]
        ↓
[Text Contains: "spam"]
    ↓ Yes              ↓ No
[Hide Comment]     [No action]

Or chain multiple conditions:

[Comment Received]
        ↓
[Text Contains: "spam"]
    ↓ Yes              ↓ No
[Hide Comment]     [Text Contains: "question"]
                        ↓ Yes              ↓ No
                   [Auto Reply]       [No action]

Available Fields

These fields are available for conditions, depending on the trigger type:

Comment Trigger Fields

FieldDescriptionExample
comment.textThe comment content"Love this post!"
comment.authorIdAuthor's platform user ID"12345678"
comment.authorNameAuthor's display name"john_doe"
comment.postIdID of the post"17891234567890"
comment.parentIdParent comment ID (if reply)null or ID

Mention Trigger Fields

FieldDescriptionExample
mention.authorIdWho mentioned you"12345678"
mention.authorNameTheir display name"jane_smith"
mention.sourceTypeWhere mentioned"post", "story", "comment"

DM Trigger Fields

FieldDescriptionExample
message.textMessage content"Hi there!"
message.senderIdSender's user ID"12345678"
message.senderNameSender's name (if available)"john_doe"
message.conversationIdConversation thread ID"conv_abc123"

Common Fields (All Triggers)

FieldDescriptionExample
platformSocial platform"instagram", "x", etc.
channelIdYour Fanbeam channel ID"ch_abc123"
timestampWhen the event occurred"2025-01-15T10:30:00Z"

Building Complex Conditions

Nested Expressions

You can nest expression conditions for complex logic:

(A AND B) OR (C AND D)

Create this by:

  1. Add Expression condition with OR combinator
  2. Inside, add two Expression conditions with AND combinators
  3. Add your specific conditions inside each

Negation

To match when something is NOT true:

Option 1: Use the "No" output

[Contains "spam"]
    ↓ No
[Your action for non-spam]

Option 2: Use "does not contain" operator (in Expression)

Expression:
  - comment.text does not contain "spam"

Combining Keywords Smartly

Instead of many separate conditions:

[Contains "price"] → [Reply]
[Contains "cost"] → [Reply]
[Contains "how much"] → [Reply]

Use a single condition with multiple keywords:

[Contains "price, cost, how much"] → [Reply]

Best Practices

Start Broad, Then Narrow

Begin with simple conditions. Add complexity only when needed to avoid false positives/negatives.

Test Your Regex

Regular expressions can be tricky. Always test with real examples before deploying.

Handle Empty Values

Some fields might be empty or missing. Consider this in your conditions:

  • Mention text is often empty (just an @)
  • Sender name isn't always available for DMs

Avoid Overlapping Conditions

If you have multiple workflows, ensure they don't conflict:

Workflow 1: "spam" → Hide
Workflow 2: "spam filter" → Reply

Issue: "spam filter question" triggers both!

Document Complex Logic

For complex expression conditions, add a note explaining the logic in plain English.

Troubleshooting

Condition Never Matches

  1. Check for typos in keywords
  2. Verify the field name is correct
  3. Test with the exact text you expect to match
  4. Check if case sensitivity is an issue

Condition Always Matches

  1. Check if keywords are too broad
  2. Verify AND vs OR logic is correct
  3. Review regex patterns for unintended matches

Inconsistent Matching

  1. Check for whitespace in keywords
  2. Verify character encoding (special characters)
  3. Review platform-specific text formatting

Actions

What your automations can do when conditions are met

Execution History

Track and debug your automation runs

On this page

Condition TypesText ContainsText Matches RegexAuthor FilterText LengthExpression (Advanced)Condition OutputsAvailable FieldsComment Trigger FieldsMention Trigger FieldsDM Trigger FieldsCommon Fields (All Triggers)Building Complex ConditionsNested ExpressionsNegationCombining Keywords SmartlyBest PracticesStart Broad, Then NarrowTest Your RegexHandle Empty ValuesAvoid Overlapping ConditionsDocument Complex LogicTroubleshootingCondition Never MatchesCondition Always MatchesInconsistent Matching