docs/en/enterprise/guides/automation-triggers.mdx
CrewAI AMP triggers connect your automations to real-time events across the tools your teams already use. Instead of polling systems or relying on manual kickoffs, triggers listen for changes—new emails, calendar updates, CRM status changes—and immediately launch the crew or flow you specify.
<Frame>  </Frame>Deep-dive guides walk through setup and sample workflows for each integration:
<CardGroup cols={2}> <Card title="Gmail Trigger" icon="envelope"> <a href="/en/enterprise/guides/gmail-trigger">Enable crews when emails arrive or threads update.</a> </Card>{" "} <Card title="Google Calendar Trigger" icon="calendar-days"> <a href="/en/enterprise/guides/google-calendar-trigger"> React to calendar events as they are created, updated, or cancelled. </a> </Card>
{" "} <Card title="Google Drive Trigger" icon="folder-open"> <a href="/en/enterprise/guides/google-drive-trigger"> Handle Drive file uploads, edits, and deletions. </a> </Card>
{" "} <Card title="Outlook Trigger" icon="envelope-open"> <a href="/en/enterprise/guides/outlook-trigger"> Automate responses to new Outlook messages and calendar updates. </a> </Card>
{" "} <Card title="OneDrive Trigger" icon="cloud"> <a href="/en/enterprise/guides/onedrive-trigger"> Audit file activity and sharing changes in OneDrive. </a> </Card>
{" "} <Card title="Microsoft Teams Trigger" icon="comments"> <a href="/en/enterprise/guides/microsoft-teams-trigger"> Kick off workflows when new Teams chats start. </a> </Card>
{" "} <Card title="HubSpot Trigger" icon="hubspot"> <a href="/en/enterprise/guides/hubspot-trigger"> Launch automations from HubSpot workflows and lifecycle events. </a> </Card>
{" "} <Card title="Salesforce Trigger" icon="salesforce"> <a href="/en/enterprise/guides/salesforce-trigger"> Connect Salesforce processes to CrewAI for CRM automation. </a> </Card>
{" "} <Card title="Slack Trigger" icon="slack"> <a href="/en/enterprise/guides/slack-trigger"> Start crews directly from Slack slash commands. </a> </Card>
<Card title="Zapier Trigger" icon="bolt"> <a href="/en/enterprise/guides/zapier-trigger">Bridge CrewAI with thousands of Zapier-supported apps.</a> </Card> </CardGroup>With triggers, you can:
To access and manage your automation triggers:
This view shows all the trigger integrations available for your deployment, along with their current connection status.
Each trigger can be easily enabled or disabled using the toggle switch:
<Frame caption="Enable or disable triggers with toggle"> </Frame>Simply click the toggle to change the trigger state. Changes take effect immediately.
Track the performance and history of your triggered executions:
<Frame caption="List of executions triggered by automation"> </Frame>Before building your automation, it's helpful to understand the structure of trigger payloads that your crews and flows will receive.
Before wiring a trigger into production, make sure you:
allow_crewai_trigger_contextThe CrewAI CLI provides powerful commands to help you develop and test trigger-driven automations without deploying to production.
View all available triggers for your connected integrations:
crewai triggers list
This command displays all triggers available based on your connected integrations, showing:
Test your crew with realistic trigger payloads before deployment:
crewai triggers run <trigger_name>
For example:
crewai triggers run microsoft_onedrive/file_changed
This command:
Your existing crew definitions work seamlessly with triggers, you just need to have a task to parse the received payload:
@CrewBase
class MyAutomatedCrew:
@agent
def researcher(self) -> Agent:
return Agent(
config=self.agents_config['researcher'],
)
@task
def parse_trigger_payload(self) -> Task:
return Task(
config=self.tasks_config['parse_trigger_payload'],
agent=self.researcher(),
)
@task
def analyze_trigger_content(self) -> Task:
return Task(
config=self.tasks_config['analyze_trigger_data'],
agent=self.researcher(),
)
The crew will automatically receive and can access the trigger payload through the standard CrewAI context mechanisms.
<Note> Crew and Flow inputs can include `crewai_trigger_payload`. CrewAI automatically injects this payload: - Tasks: appended to the first task's description by default ("Trigger Payload: {crewai_trigger_payload}") - Control via `allow_crewai_trigger_context`: set `True` to always inject, `False` to never inject - Flows: any `@start()` method that accepts a `crewai_trigger_payload` parameter will receive it </Note>For flows, you have more control over how trigger data is handled:
All @start() methods in your flows will accept an additional parameter called crewai_trigger_payload:
from crewai.flow import Flow, start, listen
class MyAutomatedFlow(Flow):
@start()
def handle_trigger(self, crewai_trigger_payload: dict = None):
"""
This start method can receive trigger data
"""
if crewai_trigger_payload:
# Process the trigger data
trigger_id = crewai_trigger_payload.get('id')
event_data = crewai_trigger_payload.get('payload', {})
# Store in flow state for use by other methods
self.state.trigger_id = trigger_id
self.state.trigger_type = event_data
return event_data
# Handle manual execution
return None
@listen(handle_trigger)
def process_data(self, trigger_data):
"""
Process the data from the trigger
"""
# ... process the trigger
When kicking off a crew within a flow that was triggered, pass the trigger payload as it:
@start()
def delegate_to_crew(self, crewai_trigger_payload: dict = None):
"""
Delegate processing to a specialized crew
"""
crew = MySpecializedCrew()
# Pass the trigger payload to the crew
result = crew.crew().kickoff(
inputs={
'a_custom_parameter': "custom_value",
'crewai_trigger_payload': crewai_trigger_payload
},
)
return result
Trigger not firing:
Execution failures:
crewai triggers run <trigger_name> to test locally and see the exact payload structurecrewai_trigger_payload parameterDevelopment issues:
crewai triggers run <trigger> before deploying to see the complete payloadcrewai run does NOT simulate trigger calls—use crewai triggers run insteadcrewai triggers list to verify which triggers are available for your connected integrationsAutomation triggers transform your CrewAI deployments into responsive, event-driven systems that can seamlessly integrate with your existing business processes and tools.