Automating Agents with Triggers

Run agents automatically in response to events — new tickets, Slack messages, custom webhooks, or recurring schedules.

What is a Trigger on Macha AI?

What is a Trigger? (Explained in 30 Seconds)

What are triggers?

Triggers let your agents run automatically in response to external events. Instead of manually starting a conversation, a trigger fires when something happens — a new support ticket, a Slack mention, a custom webhook from any system — and your agent handles it on its own.

This is how you move from reactive chat to proactive automation. An agent with a trigger can triage tickets the moment they arrive, respond to Slack mentions instantly, or run a daily summary without anyone lifting a finger.

Event triggers

Event triggers fire when something happens in a connected tool. Each connector supports a specific set of events.

Zendesk events

  • ticket.created — a new ticket is submitted
  • ticket.comment_added — a comment is added to an existing ticket
  • ticket.status_changed — a ticket's status changes (e.g., open to pending)
  • ticket.priority_changed — a ticket's priority is updated
  • ticket.assigned — a ticket is assigned to an agent or group
  • ticket.closed — a ticket is closed
  • messaging.customer_message — a customer sends a message via Zendesk Messaging

For Zendesk, most event triggers are set up automatically. When you create a trigger, Macha creates a corresponding webhook in your Zendesk account. You just need to create a Zendesk trigger rule that points to it. When you delete the trigger in Macha, the webhook is cleaned up automatically.

Freshdesk events

  • ticket.created — a new ticket is created
  • ticket.updated — a ticket is updated (status, priority, assignment, etc.)

Freshdesk triggers use the custom webhook pattern. After creating a trigger in Macha, you'll get a webhook URL and instructions for setting up an automation rule in Freshdesk that sends data to that URL.

Slack events

  • app_mention — someone mentions your Macha app in a Slack channel
  • direct_message — someone sends a direct message to your Macha app
Using Custom Triggers for AI Agents

Using Custom Triggers for AI Agents

Custom webhooks

Custom webhooks let you trigger an agent from any external service, even ones Macha doesn't have a dedicated connector for. When you create a custom webhook trigger, Macha generates a unique URL and a signing secret.

You then configure your external service to send HTTP requests to that URL. The signing secret lets you verify that incoming requests are authentic. The payload from the webhook is passed to your agent as context, so it knows what happened and can act on it.

This is useful for connecting services like GitHub, Linear, HubSpot, or any internal tool that supports outgoing webhooks.

Macha custom triggers

Macha custom triggers are a universal webhook type that doesn't require any connector. They appear under the "Macha" group in the triggers modal. Like custom webhooks, they generate a URL you can call from anywhere — but they're not tied to a specific integration. Use these when you want to trigger an agent from a script, a CI/CD pipeline, or any arbitrary HTTP request.

Scheduled triggers

How to Schedule Your AI Agents

How to Schedule Your AI Agents

Scheduled triggers run your agent automatically on a recurring schedule. Instead of waiting for an external event, the agent runs at fixed intervals — useful for daily reports, periodic data checks, or routine maintenance tasks.

How scheduling works

  • Set an interval in hours (minimum 1 hour between runs)
  • Choose a start time for the first run
  • Macha's scheduler checks every 60 seconds for triggers that are due to run

Guardrails and limits

  • Minimum interval: 1 hour — you cannot schedule an agent to run more frequently
  • Daily cap: 24 runs per trigger per day — prevents runaway schedules
  • Concurrency cap: 3 simultaneous scheduled runs per organization
  • Auto-disable: After 5 consecutive errors, the trigger is automatically disabled and you receive an email notification
  • Stale lock cleanup: If a run takes longer than 30 minutes, the lock is released so the next run can proceed
  • Credit check: Your organization must have sufficient credits before each scheduled run

Plan limits for scheduled triggers

  • Trial / Starter: Not available
  • Professional: Up to 3 scheduled triggers
  • Enterprise: Up to 20 scheduled triggers

Debounce settings

Some events fire in rapid succession — for example, a flurry of customer messages in a Zendesk Messaging conversation. Debounce settings let you batch these rapid events so your agent processes them together instead of running once per event.

You can configure a debounce window per trigger (e.g., 15 seconds for messaging events). When the first event arrives, Macha waits for the debounce period. If more events come in during that window, they're batched. Once the window closes, the agent runs with the full context.

Tip

For messaging triggers, a 15-second debounce works well — it gives the customer time to finish typing multiple messages before the agent responds.

Setting up a trigger

How to Set Up a Trigger on Your AI Agent

How to Set Up a Trigger on Your AI Agent

  1. Navigate to the agent you want to automate
  2. Open the Triggers tab
  3. Click Add trigger
  4. Select the connector and event type (or choose a Macha trigger for custom webhooks and schedules)
  5. Configure any conditions or debounce settings
  6. Save the trigger

For connector-based triggers, follow the setup instructions shown in the modal. For Zendesk, the webhook is created automatically. For Freshdesk and custom webhooks, you'll need to configure the external service to send requests to the provided URL.

To verify the trigger is firing, take an action that should trigger it (e.g., change a ticket's status, send a Slack mention) and then go to the agent's History tab. You should see the run appear there with all the steps the agent took.

Tip

Make sure your agent's instructions cover what it should do when triggered automatically. The agent won't have a human in the loop, so its instructions need to be thorough enough to handle the event independently.

Trigger best practices

Trigger Best Practices for AI Agents

Trigger Best Practices for AI Agents

Avoid overfiring triggers

Pick the most specific trigger that matches your workflow. A broad trigger like "every customer message on a ticket" fires on every new comment — and consumes a credit each time. If your agent only needs to act on certain conditions, use a more targeted Zendesk trigger or a custom webhook with conditions baked in.

Name your triggers clearly

You can have multiple triggers feeding the same agent. Name each one so it's obvious what tickets it sends through and which agent is on the receiving end. A name like "New high-priority tickets → Bug Triage Agent" reads better than "Trigger 3" when you come back six weeks later. This also makes it easier to debug when something fires unexpectedly.

Custom webhooks: keep things organized externally

When you add a custom webhook trigger on Zendesk, Macha automatically creates the webhook on your Zendesk instance — you just search for it and select it inside Zendesk's trigger setup. For custom webhooks from external (non-Zendesk) systems, Macha generates a webhook URL — make sure you keep clear notes on which event maps to which trigger so future-you isn't guessing.

Always test before going live

Simulate the trigger event manually in chat first. Make sure the agent does exactly what you expect before turning the trigger on for real tickets. Once it's running autonomously, mistakes execute immediately with no confirmation step.

© 2026 AGZ Technologies Private Limited