Skip to main content

Triggers

Triggers automatically run an agent when something happens — no schedule required. Where a Job runs an agent on a fixed clock, a Trigger runs an agent in reaction to an event, letting your workspace respond the moment something changes.

ToothFairyAI supports two event sources:

  • Native — ToothFairyAI's own platform events (a document is created, an agent completes, a planner is awaiting approval, etc.).
  • External — Trigger events emitted by third-party apps (Google Drive, Slack, GitHub, Salesforce, Stripe, Notion, Jira, and many more). External triggers are acquired by polling the provider with a configured Authorisation.

When a trigger fires, it sends the bound prompt (or forced prompt) to the selected agent exactly as a manual chat run would.

Triggers can be created and managed from the following menu: Settings > Triggers > Create trigger

Create a trigger

Basic Information

  1. Click on the Create trigger button.
  2. Name — Assign a unique name to identify the trigger.
  3. Description (optional) — Describe what this trigger does and when it should fire.

Execution Configuration

  1. Agent — Select the agent that will run when the trigger fires. Voice-mode agents are excluded from the dropdown (triggers target text-capable agents).
  2. Prompt — Choose the prompt sent to the agent. Available prompts are your saved prompts (see Prompting). The dropdown only lists prompts made available to the selected agent. You can provide a Forced Prompt instead — free-text instructions (max 1024 characters) used directly as the agent's input. Either a prompt or a forced prompt is required.
No prompts available

If the selected agent has no prompts assigned to it — and you have not provided a forced prompt — the form shows a placeholder linking you straight to the Generation settings section to create one.

Event Configuration

  1. Event Source — Choose where the triggering event comes from:

Native (ToothFairyAI events)

React to events produced inside your ToothFairyAI workspace.

  • Native Event Type — The platform event to listen for (e.g. document.created, agent_completed, planner_pending_approval). See the Native events table below.

  • Data Filter (optional) — Narrow the trigger to events whose payload matches conditions you define. Each row is a field / operator / value triple:

    OperatorMeaning
    equalsField equals the value
    not equalsField does not equal the value
    includesField contains the value
    greater thanField is numerically greater than the value
    less thanField is numerically less than the value
    existsField is present in the payload

    Add as many rows as you need; an event must satisfy all rows to fire. Empty field rows are ignored on save.

External (3rd-party app)

React to events emitted by an external provider.

  • Provider — The third-party app to listen to (e.g. Google Drive, Slack, GitHub). Providers that are registered but not yet fully implemented are shown with a (soon) badge and cannot be saved until their adapter lands.
  • Provider Event — The specific event from the provider (e.g. drive.file.created, slack.message.mentioned, github.pr.merged).
  • Authorisation — The credential the trigger will use to poll the provider. The dropdown lists every Authorisation you have configured in the workspace; the selected authorisation's type is stored as the trigger's authorisation type on save.
  • Acquisition Mode — How ToothFairyAI acquires the event:
    • Polling (default) — Periodically polls the provider's API for new items.
    • Webhook (soon) — Receive push events from the provider. Not yet available.
  • Poll Interval (Polling only) — How often to poll. Options: 1, 2, 5, 10, or 30 minutes (default 5 minutes).
  • Poll Endpoint (Generic REST provider only) — The full URL to poll, e.g. https://api.example.com/v1/items.
  • JSONPath (Generic REST provider only) — The JSONPath expression used to extract the list of new items from each poll response, e.g. $.items[*].
Authorisation required

External triggers need a provider Authorisation to authenticate the poll. If no Authorisations exist when an external provider is selected, the form shows a hint — create an Authorisation first, then return to the trigger.

Status

  1. Active — Toggle to arm or pause the trigger. When active, the trigger is saved with status ARMED and will fire on matching events. When inactive it is saved as PAUSED and will not fire until re-enabled.

  2. Click on the Create button to save the trigger.

Native events

These are ToothFairyAI's own platform events, organized by category:

Event IDCategoryLabelDescription
document.createddocumentsDocument CreatedA new document has been created in the workspace
document.updateddocumentsDocument UpdatedAn existing document has been modified
document.deleteddocumentsDocument DeletedA document has been deleted from the workspace
agent_completedagentAgent CompletedAn agent has successfully completed processing a chat message
agent_failedagentAgent FailedAn agent encountered an error while processing a chat message
planner_completedplannerPlanner CompletedA planner has successfully completed all plan steps
planner_failedplannerPlanner FailedA planner encountered an error during execution
planner_pending_approvalplannerPlanner Pending ApprovalA generated plan is awaiting user approval
planner_stoppedplannerPlanner StoppedPlan execution was stopped by the user
Webhooks

Native events are the same events ToothFairyAI emits over its webhooks. Pairing a trigger with a native event is the in-app way to react to those same lifecycle events.

External providers

The provider catalog is served live from the ToothFairyAI backend and rendered in the form, so new providers appear automatically. The providers below are currently implemented (field-complete polling adapters):

ProviderAuth typeExample events
Google DriveOAuthdrive.file.created, drive.file.updated, drive.file.deleted, drive.folder.created
Microsoft Graph (SharePoint / Azure / OneDrive)OAuthgraph.drive.item.created, graph.list.item.created, graph.calendar.event.created, graph.mail.received
SlackOAuthslack.message.posted, slack.message.mentioned, slack.reaction.added, slack.file.shared
GitHubOAuthgithub.issue.opened, github.pr.merged, github.push, github.release.published, github.star.created
NotionOAuthnotion.page.created, notion.page.updated, notion.database.created
DropboxOAuthdropbox.file.created, dropbox.file.updated, dropbox.file.deleted, dropbox.folder.created
BoxOAuthbox.file.created, box.file.updated, box.file.deleted, box.comment.created
OneDriveOAuthonedrive.file.created, onedrive.file.updated, onedrive.file.deleted
SalesforceOAuthsalesforce.lead.created, salesforce.opportunity.updated, salesforce.case.created, salesforce.custom.object.created
HubSpotOAuthhubspot.contact.created, hubspot.deal.created, hubspot.ticket.created, hubspot.form.submitted
LinearOAuthlinear.issue.created, linear.issue.status.changed, linear.project.created
JiraOAuthjira.issue.created, jira.issue.updated, jira.sprint.started, jira.version.released
AsanaOAuthasana.task.created, asana.task.completed, asana.project.created
TrelloOAuthtrello.card.created, trello.card.moved, trello.card.commented
ZendeskBasiczendesk.ticket.created, zendesk.ticket.assigned, zendesk.user.created
ServiceNowBasicservicenow.incident.created, servicenow.change.request.created, servicenow.problem.created
YouTubeOAuthyoutube.video.uploaded, youtube.comment.created, youtube.subscriber.threshold
GmailOAuthgmail.message.received, gmail.message.received.label, gmail.message.sent
Google CalendarOAuthcalendar.event.created, calendar.event.started, calendar.event.attendee.response, calendar.reminder
Microsoft FormsOAuthforms.response.created, forms.response.updated, forms.form.created
Microsoft TeamsOAuthteams.message.created, teams.message.mentioned, teams.channel.created, teams.member.added
StripeAPI Keystripe.payment.intent.succeeded, stripe.charge.refunded, stripe.customer.created, stripe.subscription.created, stripe.invoice.paid
Generic REST (API Key / OAuth)API Keygeneric.poll — periodically GET a custom REST endpoint and emit items via JSONPath

Each provider exposes its own event list in the Provider Event dropdown; only events valid for the selected provider are shown.

Polling fallback

For a handful of providers (Slack, GitHub, Box, Linear, Zendesk, Stripe) the native acquisition mode is webhook-based; ToothFairyAI implements a polling adapter for these as a functional fallback, with webhook ingestion arriving in a later release.

Managing triggers

Once created, triggers appear in the triggers list with their name, bound agent, event source, and status.

StatusMeaning
ARMEDTrigger is active and will fire on matching events
PAUSEDTrigger is inactive and will not fire

Edit a trigger

  1. Click on an existing trigger from the list.
  2. The edit modal displays the trigger ID and all configuration options.
  3. Modify any settings as needed.
  4. Click Save to update the trigger.

Delete a trigger

  1. Open the trigger you want to delete.
  2. Click the Delete button at the bottom of the edit modal.
  3. Confirm the deletion when prompted.

Triggers vs Jobs

TriggersJobs
Runs onAn event occurringA fixed schedule
Best forReal-time reaction to changesRepetitive, clock-driven tasks
Event scopeNative platform events or 30+ external providersYour workspace only
AcquisitionPolling (webhook soon)Internal scheduler

For proactive, time-boxed automation use a Job; for reactive, event-driven automation use a Trigger. Combine both — e.g. a Slack-triggered agent that runs on every new mention, plus a daily routine job that summarizes the day's activity.

Use cases

Native

  • Document lifecycle — Re-index or summarize a document the moment it's created or updated.
  • Agent completion — Trigger a downstream agent (notification, logging) whenever another agent finishes.
  • Planner approval — Send a Slack or email alert when a generated plan is awaiting approval.

External

  • Support triagezendesk.ticket.created → an agent drafts a first-pass response and suggests a category.
  • Sales follow-uphubspot.deal.created / salesforce.opportunity.updated → an agent drafts a tailored follow-up email.
  • Code review assistgithub.pr.opened → an agent reads the diff and posts a review checklist.
  • Inbound email triagegmail.message.received (label) → an agent categorizes and routes the email.
  • Payment alertsstripe.charge.dispute.created → an agent summarizes the dispute and drafts a customer response.
  • Calendar reminderscalendar.event.starts → an agent prepares an agenda from related materials.
  • Custom APIgeneric.poll against your own REST endpoint → an agent acts on every new item.

Best practices

  1. Pick the lightest source — Prefer a Native event over an external poll when the workflow only needs to react to something inside ToothFairyAI.
  2. Use data filters — Narrow Native triggers with data-filter rows so the agent only fires on events it actually needs to act on.
  3. Right-size the poll interval — Use the smallest interval that still avoids hitting a provider's rate limits. 30 minutes is plenty for slow-moving data; 1–2 minutes only when latency matters.
  4. Scope prompts to the agent — Assign the bound prompt to the trigger's agent (via availableToAgents) so the dropdown shows only relevant prompts.
  5. Reuse Authorisations — One provider Authorisation can back several triggers; configure it once in Authorisations and reuse it.
  6. Naming — Use descriptive names that state provider + event + intent, e.g. "Slack mention → triage agent".
  7. Start armed, observe first — Arm the trigger and watch a few fires' outputs in External chats before relying on it in production.
  8. Pause, don't delete — Temporarily pausing a trigger keeps its configuration intact while you investigate or re-tune.
Execution limits

Triggers are subject to the same execution limits as manual agent runs — token limits, execution timeouts, and rate limits based on your subscription tier. Averted triggers still consume a poll against the provider's API on each interval.

Agent availability

Only agents that have been previously created and saved in your workspace appear in the agent dropdown. Voice-mode agents are excluded. Ensure the necessary agent is configured before creating a trigger.