BLOG

How to manage ilert call flows via Terraform

Marko Simon
October 23, 2025
Table of Contents:

Call flows let you design voice workflows with nodes like “Audio message,” “Support hours,” “Voicemail,” “Route call,” and much more. The ilert Terraform provider now includes a ilert_call_flow resource so you can version and promote these flows across environments. This blog post offers an overview of managing call flows in Terraform, detailing the benefits and key scenarios.

Benefits of managing call flows via the Terraform provider

The ilert_call_flow Terraform resource enables you to define node-based call flows as code, alongside alert sources, escalation policies, and on-call schedules. This brings call routing under the same IaC process you may already use for ilert.

Storing call flows in Terraform makes changes controlled, testable, and auditable. You gain code review, diffs before apply, consistent promotion between staging and production, and easy rollback. Teams can also import existing UI-created resources into state to avoid rebuilds.

Simple call flow: create alert

A call flow for creating alerts when somebody picks up the call looks like this:

1resource "ilert_call_flow" "call_flow" {
2  name     = "Call Flow Demo"
3  language = "en"
4
5  root_node {
6    node_type = "ROOT"
7
8    branches {
9      branch_type = "ANSWERED"
10
11      target {
12        node_type = "CREATE_ALERT"
13        metadata {
14          alert_source_id = "your_alert_source_id"
15        }
16      }
17    }
18  }
19}

What happens: ROOT waits for an incoming call. On ANSWERED, the flow creates an alert in the given alert source, so your existing escalation policies take over.

Please note that phone numbers cannot be assigned via Terraform. After the first application, assign a number to the call flow in the web UI.

Complex call flow: Support hotline

You can create more sophisticated flows, too. For example, a support hotline with branches during or outside of business hours. Start with the ROOT node and open the first path by reacting when the call is answered.

1resource "ilert_call_flow" "business_hours_support" {
2  name     = "Business Hours Support"
3  language = "en"
4
5  root_node {
6    node_type = "ROOT"
7
8    branches {
9      branch_type = "ANSWERED"
10      # ...

Then greet the caller with a short TTS welcome message.

1# ...
2target {
3    node_type = "AUDIO_MESSAGE"
4    metadata {
5      text_message   = "Thank you for calling <company name>."
6      ai_voice_model = "emma"
7    }
8# …

Now introduce Support hours and branch the flow into OUTSIDE and DURING states.

1# ...
2branches {
3  branch_type = "CATCH_ALL"
4
5  target {
6    node_type = "SUPPORT_HOURS"
7    metadata {
8      support_hours_id = …
9    }
10
11    branches {
12      branch_type = "BRANCH"
13      condition   = "context.supportHoursState == 'OUTSIDE'"
14      # ...
15    }
16
17    branches {
18      branch_type = "BRANCH"
19      condition   = "context.supportHoursState == 'DURING'"
20      # ...
21    }
22# …

Handle OUTSIDE hours next: send to voicemail, and if a recording exists, create an alert for follow-up.

1# ...
2target {
3    node_type = "VOICEMAIL"
4    metadata {
5      text_message   = "You've reached us outside of our business hours. Please leave your name, contact information, and a brief message."
6      ai_voice_model = "emma"
7    }
8
9    branches {
10      branch_type = "BRANCH"
11      condition   = "context.recordedMessageUrl != null"
12    
13      target {
14        node_type = "CREATE_ALERT"
15        metadata {
16          alert_source_id = ...
17        }
18      }
19    }
20}
21# …

Finish with DURING hours: try the primary user first, then fall back if unavailable.

1# ...
2target {
3    node_type = "ROUTE_CALL"
4    metadata {
5      call_style = "ORDERED"
6      targets {
7        type   = "ON_CALL_SCHEDULE"
8        target = "your_schedule_id"
9      }
10    }
11}
12# …

The full script with both call flow resources can be found in our public Terraform playground.

Other blog posts you might like:

Ready to elevate your incident management?

Start for free
Our Cookie Policy
We use cookies to improve your experience, analyze site traffic and for marketing. Learn more in our Privacy Policy.
Open Preferences
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.