Skip to main content

Automation Reference

Complete reference guide for building automations in Alguna. This page documents all available triggers, actions, step types, template syntax, and condition expressions.

Trigger Types

Triggers define when an automation runs. Each trigger provides specific data that can be used in subsequent steps.

Payment Failed

Fires when a payment attempt fails. Example trigger data:

Invoice Status Updated

Fires when an invoice status changes. Status values: draft, issued, paid, void, past_due, uncollectible Example trigger data:

Prepaid Usage Update

Fires when prepaid credit usage changes significantly. Example trigger data:

Subscription Sent for Signature

Fires when a subscription requires signature. Example trigger data:

Credits Depleted

Fires when credit balance reaches zero or a threshold. Example trigger data:

Subscription Status Updated

Fires when a subscription status changes. Status values: draft, pending, active, paused, canceled, expired Example trigger data:

Action Types

Actions are the operations performed by your automation.

Communication Actions

send_email

Send an email using a template.

send_slack_message

Send a Slack message to a selected channel in a connected Slack workspace. If no Slack workspace is connected, users who can manage integrations can connect Slack inline from the automation form. Other users see helper text directing them to Settings > Integrations.

send_invoice_reminder

Send a payment reminder for an invoice.

send_invoice_reminders_bulk

Send reminders for multiple invoices.

send_billing_info_request

Request updated billing information from customer.
Send customer portal access link.

send_subscription_signature_reminder

Remind customer to sign a pending subscription.

send_subscriptions_autorenewal_notification_bulk

Notify customers about upcoming auto-renewals.

Data Retrieval Actions

get_invoice

Retrieve a single invoice. Outputs: Full invoice object including line items, status, amounts.

get_invoices

Retrieve multiple invoices with filters. Outputs: Array of invoice objects.

get_subscription

Retrieve a single subscription. Outputs: Full subscription object with current version.

get_subscriptions

Retrieve multiple subscriptions with filters. Outputs: Array of subscription objects.

Billing Actions

retry_invoice_payment

Retry payment collection for an invoice.

cancel_subscription

Cancel a subscription.

Integration Actions

send_webhook

Send data to an external webhook.

Step Types

Automations are composed of steps that execute in sequence.

Action Step

Execute a single action.

Condition Step

Branch based on a condition.

Delay Step

Wait before continuing.
Duration formats: 30m (minutes), 24h (hours), 7d (days)

ForEach Step

Iterate over a collection.

DoUntil Step

Repeat until a condition is met.

Template Syntax

Use templates to reference dynamic data in your automation.

Basic Syntax

Access data using double curly braces:

Accessing Trigger Data

Accessing Step Outputs

Reference outputs from previous steps:

Built-in Variables

Filters

Transform values with filters:

Condition Syntax

Conditions use the Expr expression language.

Comparison Operators

Logical Operators

String Operations

Array Operations

Null Checks


Complete Examples

Dunning Automation

Progressive payment failure handling:

Renewal Notification Automation

Notify customers before renewal:

Low Credit Balance Alert

Alert when credits are running low:

Error Handling

Retry Configuration

Configure retry behavior for actions:

On Error Handling

Define behavior when a step fails:
Error actions:
  • stop - Halt automation
  • continue - Skip and continue
  • goto - Jump to specific step

Best Practices

Use Descriptive IDs

Name steps clearly: send_gentle_reminder not step_1.

Test with Small Batches

Test automations with filtered triggers before going live.

Add Delays Thoughtfully

Avoid overwhelming customers with rapid-fire communications.

Log External Calls

Use webhooks to log automation events for debugging.

Next Steps

Automation Overview

Getting started with automations.

Triggers

Learn about trigger types.

Actions

Explore available actions.

Conditions

Build conditional logic.