Skip to content
Dailybot Help Center
Dailybot Help Center

Use pre-conditions to trigger your workflows

What are pre-conditions?

Pre-conditions are specific criteria that must be met for an action to continue or for a workflow to stop. They help ensure that automated processes run smoothly and only when the necessary conditions are satisfied.

Using AI pre-conditions

To ensure effective automation, it's important to clearly define what must be validated for the action to continue and what conditions should prevent execution. Additionally, the AI has contextual awareness, such as the current date, which can be useful for setting time-based conditions. By following these tips, you can create more reliable and controlled workflows.

Note: Our system uses advanced models from OpenAI's O3 to review the requirements before the workflow is run. You can find this option in all of our paid plans.

Real case examples:

  • Send a message to a DM or specific channel if the reported blocker is infrastructure related.

Infra blocker:
If {{response_3}} includes terms related to infrastructure problems (e.g., "server down," "network failure," "database issue"), continue. Otherwise, skip.

 

 

  • Only send an email if certain criteria are met on a form, for example a good sales lead.

Sales lead:
Send an email only if all of the following conditions are met: 

The "{{input_event.payload.data.request_demo}}" field is set to "Yes". 

The "{{input_event.payload.data.urgency}}" field includes "Immediate". 

The "{{input_event.payload.data.company_size}}" is 500 employees or more.

 


Using program logic

  1. Use Twig Template conditions. You can read the documentation here.

  2. Variables inside the Twig Template don't need to be called again with braces. Instead of using {{response_3}} you should use: response_3 directly.

  3. When the condition is met, the word "continue" must be specified since this is the criterion that the workflow takes into account to continue with the action.

Note: If the condition isn't met, the workflow will stop executing in its entirety.

Real case example: Consider a scenario where the trigger is "User completes a check-in" or "Form received new response/record," and you want to send a message only when a specific response is received.

Line by line explanation:

  1. {% if response_2 == 'no-yet' %} ➝ Checks if the answer to question number 2 is equal to "no-yet."

  2. continue ➝ Essential for workflow continuation.

  3. {% endif %} ➝ Closes the condition.

Useful examples:

  • Normal condition strictly evaluating the equality of values:

    twig

    {% if response_2 == 'no-yet' %}

    continue

    {% endif %}

  • Two conditions evaluating the equality of values:

    {% if response_2 == 'no-yet' and response_3 == 'ok' %}

    continue

    {% endif %}

  • Loop iterating a variable containing several values:

    {% for assignees in input_event.payload.assignees %}

    {% if assignees.username == 'Johanna' %}

    continue

    {% endif %}

    {% endfor %}

  • Evaluating logic with different operators (e.g., !=, <, >, <=, >=):

    {% if 'bc' in 'abcdef' %}

    continue

    {% endif%}

Notes:

  • Access variables via "dots" (e.g., input_event.payload.assignees).

  • Specify button values separated with a "dash" (e.g., response_1 == 'no-yet').

  • {% if response_1 == 'no-yet' %}

  • continue
    {% endif %}

 

Got additional questions? Submit a new ticket.