Dhanur AI
Docs menu· When something happens

Start an agent when something happens

Live

Start an agent on its own when a lead is saved, a HubSpot contact is added, a row lands in a Google Sheet or Form, a Razorpay payment or a Shopify or WooCommerce order comes in, and more.

Some work should start by itself. When your website agent saves a lead, a second agent can look up the company and email your sales team a short brief. When a conversation is handed to a person, an agent can post it to the right people with the reason. Nobody has to type anything.

This is a trigger, like a schedule or a webhook, that listens for something happening in your workspace, in your HubSpot, in a Google Sheet or in your online store.

You need the Owner, Admin or Builder role to add one.

What can start an agent

When Happens when Fields you can use
A lead is saved An agent saves a lead in a real conversation, once it has been checked against the agent's criteria. The same person saved again counts again. Name, phone, email, what they need, budget, timeline, score (1 to 5), verdict, stage, a link to the lead
A lead changes stage A lead moves stage in Leads: qualified by its agent, a call booked, or marked won or lost by your team. Test leads never do. The new and old stage, who moved it (ai, owner or system), name, phone, email, what they need, score, verdict, where they came from, the value when won, a link to the lead
An appointment is booked An agent books an appointment on your Google Calendar. When (India time), the customer's name, phone and email, the reason
A task is handed to a person An agent hands a conversation to your team. The conversation's first words, why, where it came from, a link to the task
A task fails An agent's task stops with an error. The conversation's first words, what went wrong, where it came from, a link
An outreach email is answered Someone replies to an email from one of your outreach campaigns. The campaign, their name, company and email, the start of their reply
Meeting notes are written An agent writes the notes from a meeting its notetaker attended. The platform, how many minutes, the notes
A HubSpot contact is created A contact is added to your HubSpot, by a form, an import or a person. Name, email, phone, company, job title, lifecycle stage, lead status, a link to the contact
A HubSpot contact changes lifecycle stage A contact moves to another stage, such as lead to customer. The new stage, and the contact's fields
A row is added to a Google Sheet A new row appears in a sheet shared as "anyone with the link", such as the answers sheet of a Google Form. Every column, by its heading

Events inside Dhanur AI also carry the name of the agent whose work caused them. Payments and orders from your online store come in through a webhook: see Payments and orders from your store.

Coming later: HubSpot deals, private Google Sheets, and more apps.

Set it up

  1. Open the agent that should do the work. On the Build tab, scroll to Triggers.
  2. Select Add trigger, then When something happens.
  3. Under When, pick the event.
  4. Optional: add filters under Only when, such as "Score is more than 3" or "Where it came from is whatsapp". All filters must match. Text ignores capitals, and numbers can include ₹ and commas.
  5. Optional: write the message the agent gets. Put a field in double curly brackets, such as {{lead.name}}, or select a field under the box to add it. Leave the box empty to use the message shown in grey. What the agent gets shows your message filled in with an example.
  6. Select Add trigger. If the agent isn't live yet, publish it: triggers only run the published version.

HubSpot

Connect HubSpot under Integrations first. Then HubSpot tells us straight away when a contact is added or changes stage, and the agent gets the contact's details, read with your connection.

  • Loops are stopped. When an agent's lead is copied to HubSpot, the new contact doesn't start that same agent again. Other agents can still answer it.
  • Several HubSpot accounts: every HubSpot account connected to the workspace counts. Add a filter, such as "Lifecycle stage is lead", to narrow it down.
  • Nothing extra to allow: it uses the contacts permission you already gave when connecting.

Google Sheets and Google Forms

  1. Share the sheet: in Google Sheets choose Share, then General access, then Anyone with the link. For a Google Form, open its answers sheet (Responses, then Link to Sheets) and share that.
  2. When you add the trigger, paste the sheet's link, pick the tab if it has more than one, and select Check the sheet. You see how many rows it has and its columns, which you can then use in filters and the message, such as {{row.phone_number}} for a column headed "Phone number".
  3. Select Add trigger.
  • Only new rows count. The rows already in the sheet when you add the trigger never start anything.
  • Checked every 5 minutes, so a run can start up to 5 minutes after the row appears.
  • A big paste arrives in steps: at most 20 new rows are sent each check, and the rest follow at the next checks, in order.
  • Rows that are removed don't start anything, and new rows after them still do.
  • If the sheet can't be read (made private, deleted, or the tab renamed), the trigger shows Failed with the reason. It keeps trying, and carries on once the sheet can be read again.
  • Private sheets can't be used yet: that needs a Google permission we can only use once Google has verified our app.

Payments and orders from your store

Razorpay, Shopify and WooCommerce can call a web address when something happens. Add a webhook for them:

  1. Open Triggers, select Add trigger, then Webhook.
  2. Under What sends it?, pick Razorpay, Shopify or WooCommerce, and tick the events that should start the agent.
  3. Optional: write the message. Fields such as {{order.total}}, {{order.items}} and {{customer.phone}} read the same for every store, and amounts are in rupees, such as ₹1,299. Leave it empty for a ready-made message.
  4. Select Create webhook and follow the steps shown for your store:
Store Where to add it The key
Razorpay Dashboard: Account & Settings, then Webhooks, then Add New Webhook. Tick the same Active Events. Paste the secret we show once into Razorpay's Secret box.
WooCommerce WordPress: WooCommerce, then Settings, Advanced, Webhooks, Add webhook. Pick the Topic, such as Order created. Paste the secret we show once into WooCommerce's Secret box.
Shopify Admin: Settings, then Notifications, then Webhooks, then Create webhook. Pick the event, JSON, and the latest API version. Shopify shows "Your webhooks will be signed with" a key under the list. Paste it into the trigger.

Every call is checked with the store's own signature, so nobody else can start your agent through that address. When a store sends the same call again, the first task is returned instead of starting another. Lost the secret? For Razorpay and WooCommerce, create a new one from the trigger's ⋯ menu and paste it into the store again.

Test it

Open the trigger's ⋯ menu and select Run a test. The agent starts straight away with the latest real event of that kind, or with an example if there hasn't been one yet. The test goes through the trigger's filters, so it also tells you when they would leave the event out.

A test is a real run: it follows your approval settings, is charged like any run, and shows in Tasks as "a test".

When it doesn't start

The trigger shows Skipped with the reason when:

  • It came from this agent's own work. An agent never starts from an event it caused, so a lead qualifier listening for "A lead is saved" doesn't restart itself for its own leads.
  • Too many agents started each other in a row. After 3 agents in a chain, the next one doesn't start, so two agents can't keep starting each other.
  • It already started for this a moment ago. Several changes to the same record within 2 minutes start one run.
  • It reached its limit of runs an hour. 30 by default.
  • The agent is paused or not published, AI work is paused on the platform, or today's spending limit was reached.

You can change the 2 minutes and the 30 runs under Limits when you add the trigger. Events that the filters leave out don't show as skipped: the trigger simply doesn't answer them.

In Tasks

Each run is a new task. Its channel is Event, and Started by shows the trigger's name and what happened, for example "Send a brief · A lead is saved". The message it started with is marked Trigger.

Let an agent come back later

Sometimes the work isn't done in one go: "check again tomorrow whether order 1182 has shipped". Turn on the Schedule a follow-up tool in the agent's Tools, and the agent can book its own return to the same conversation, with a note of what to do then.

  • It works in Team chat, Slack, and runs started by the run API, a schedule, a webhook or an event. In customer chats it can't, because quiet customer follow-ups already do that job.
  • The time can be from 15 minutes to 30 days ahead, in India time.
  • A conversation can have 3 follow-ups waiting at most.
  • In the test chat, the agent says when it would come back, but nothing is booked.

Good to know

  • Only real work starts triggers. Test chats in the builder never do.
  • Workforces too. A workforce's Triggers section has the same options.
  • What we keep: events are stored only while a trigger listens for them, encrypted, and deleted after 30 days.
  • Cost: a run is charged for its AI and tool use like any other task. Starting it is free. See Limits and costs.

Last updated 24 September 2026

Something unclear or wrong? Tell us