LogoLogo
  • Introduction
    • Welcome
    • Quickstart
  • Platform
    • Connections
      • Jobs
      • Sync types
      • Sync schedule
      • Column Anonymization
      • Block Window
    • Connect to databases
    • Running jobs manually
    • Alert Integrations
      • Discord
      • Email
      • Slack
    • Runs history
    • How we move data
  • Connectors
    • APIs
      • ActiveCampaign
      • Amplitude
      • Asaas
      • Asana
      • Bling
      • Beehiiv
      • BomControle
      • Campaign Monitor
      • ClickUp
      • Conta Azul
      • Convenia
      • CustomerX
      • Delighted
      • Facebook Ads
      • FreshChat
      • Freshdesk
      • Gainsight
      • Google Ads
      • Hotmart
      • HubSpot
      • Intercom
      • Jira
      • Linkedin Ads
      • MailChimp
      • MailGun
      • Mixpanel
      • Monday
      • Movidesk
      • Omie
      • Pipefy
      • Qulture.Rocks
      • RD Station CRM
      • RD Station Marketing
      • Sankhya
      • Sentry
      • Stripe
      • Superlógica
      • Tiny
      • Teamwork Desk
      • Track.co
      • Twitch.tv
      • Twygo
      • Typeform
      • Vindi
      • Zendesk
    • Databases
      • Firebird
      • MySQL
      • Neo4j
      • Oracle
      • PostgreSQL
  • Destinations
    • BigQuery
      • Hosted by Erathos
    • Databricks
    • PostgreSQL
      • Aws (RDS)
      • Azure
    • Redshift
    • S3 Iceberg
  • API
    • Introduction
      • Trigger jobs outside Erathos
      • Trigger jobs in Erathos
    • Quickstart
      • Airflow
      • Dbt Cloud
      • Erathos
      • Prefect
    • Concepts
      • Authentication
      • Metadata
      • Rules
      • Variables and secrets
    • API Reference
      • Jobs
      • Orchestration
      • Secrets
      • Variables
      • Workspaces
  • Settings
    • User settings
    • Workspace settings
Powered by GitBook
On this page
  • Overview
  • Examples
  • Execution status
  • Dependent jobs
  • Time
  • Execution type
  • Schedules
  • Orchestration
  1. API
  2. Concepts

Rules

Overview

If you prefer to receive notifications only when predefined criteria are met, you can set up rules when creating a orquestration webhook. The rules consist of three components: variable, operation, and value.

The available operations vary depending on the data type of the variable:

uuid and string

EQUAL, NOT_EQUAL, IN, NOT_IN

integer

EQUAL, NOT_EQUAL, IN, NOT_IN, LESS_THAN, GREATER_THAN

date and time

LESS_THAN, GREATER_THAN

boolean

EQUAL, NOT_EQUAL

Rules must be specified during the creation of a webhook, provided via the rules attribute. Below is an example of a body with multiple rules for reference:

{   
    "description": "airflow_trigger_example",
    "is_active": true,
    "jobs": [
        "uuid_1", 
        "uuid_2", 
        ..., 
        "uuid_n"
    ],
    "method": "POST",
    "url": "https://{{variables.TOOL_URL}}/api/v1/dags/{{erathos.JOB_ID}}/dagRuns",
    "header": {
        "Content-Type": "application/json",
        "Authorization": "Basic ${{secrets.USER_KEY}}"
    },
    "body": {
        "conf": {
            "name": "{{erathos.TABLE_NAME}}",
            "status": "${{erathos.STATUS}}"
        }
    },
    "rules": [
        {
            "erathos_variable": "STATUS",
            "operation": "EQUAL",
            "value": "FINISHED"
        },
        {
            "erathos_variable": "ROWS",
            "operation": "GREATER_THAN",
            "value": "0"
        },
        {
            "erathos_variable": "FINISHED_AT_TIME",
            "operation": "GREATER_THAN",
            "value": "00:00"
        },
        {
            "erathos_variable": "FINISHED_AT_TIME",
            "operation": "LESS_THAN",
            "value": "08:00"
        },
        {
            "erathos_variable": "FINISHED_AT_WEEKDAY",
            "operation": "NOT_IN",
            "value": ["0", "6"]
        }
    ]
}

Examples

Below are groups of frequently used rules that can be included in your custom webhooks and combined with the webhook templates presented next.

Execution status

Success

Every successful execution that has encountered any data.

{
  ...
  "rules": [
    {
      "variable_name": "STATUS",
      "operation": "EQUAL",
      "value": "FINISHED"
    },
    {
      "variable_name": "ROWS",
      "operation": "GREATER_THAN",
      "value": "0"
    }
  ],
  ...
}

Failed

Every execution that results in a failure.

Dependent jobs

Filter only the main tables (endpoints with nested tables generate a separate webhook for each table when this rule is not used).

{
  ...
  "rules": [
    {
      "variable_name": "NESTED_TABLE",
      "operation": "EQUAL",
      "value": "false"
    },
  ],
  ...
}

Time

Executions during weekdays between 00:00 BRT and 08:00 BRT.

{
  ...
  "rules": [
    {
      "variable_name": "FINISHED_AT_WEEKDAY",
      "operation": "IN",
      "value": ["1", "2", "3", "4", "5"]
    },
    {
      "variable_name": "FINISHED_AT_TIME",
      "operation": "GREATER_THAN",
      "value": '02:59'
    },
    {
      "variable_name": "FINISHED_AT_TIME",
      "operation": "LESS_THAN",
      "value": "11:00"
    }
  ],
  ...
}

Execution type

Filter only Full Refresh executions.

{
  ...
  "rules": [
    {
      "variable_name": "FORCE_HISTORY",
      "operation": "EQUAL",
      "value": "true"
    },
  ],
  ...
}

Schedules

Filter only scheduled executions.

{
  ...
  "rules": [
    {
      "variable_name": "TRIGGERED_BY",
      "operation": "EQUAL",
      "value": "Erathos Schedule"
    },
  ],
  ...
}

Orchestration

Filter only executions triggered programmatically.

{
  ...
  "rules": [
    {
      "variable_name": "IS_ORCHESTRATION",
      "operation": "EQUAL",
      "value": "true"
    },
  ],
  ...
}

PreviousMetadataNextVariables and secrets

Last updated 5 months ago

To discover the variables available for creating rules, refer to .

Metadata