Framework for orchestrating role-playing, autonomous AI agents. By fostering collaborative intelligence, CrewAI empowers agents to work together seamlessly, tackling complex tasks.
feat: add docs about Automation triggers (#3375)
Lucas Gomide1217935b3198
diff --git a/docs/docs.json b/docs/docs.jsonindex 015a24529..e9b4c60bc 100644--- a/docs/docs.json+++ b/docs/docs.json@@ -320,6 +320,7 @@"en/enterprise/guides/update-crew","en/enterprise/guides/enable-crew-studio","en/enterprise/guides/azure-openai-setup",+ "en/enterprise/guides/automation-triggers","en/enterprise/guides/hubspot-trigger","en/enterprise/guides/react-component-export","en/enterprise/guides/salesforce-trigger",@@ -658,6 +659,7 @@"pt-BR/enterprise/guides/update-crew","pt-BR/enterprise/guides/enable-crew-studio","pt-BR/enterprise/guides/azure-openai-setup",+ "pt-BR/enterprise/guides/automation-triggers","pt-BR/enterprise/guides/hubspot-trigger","pt-BR/enterprise/guides/react-component-export","pt-BR/enterprise/guides/salesforce-trigger",@@ -1007,6 +1009,7 @@"ko/enterprise/guides/update-crew","ko/enterprise/guides/enable-crew-studio","ko/enterprise/guides/azure-openai-setup",+ "ko/enterprise/guides/automation-triggers","ko/enterprise/guides/hubspot-trigger","ko/enterprise/guides/react-component-export","ko/enterprise/guides/salesforce-trigger",diff --git a/docs/en/enterprise/guides/automation-triggers.mdx b/docs/en/enterprise/guides/automation-triggers.mdxnew file mode 100644index 000000000..872724b44--- /dev/null+++ b/docs/en/enterprise/guides/automation-triggers.mdx@@ -0,0 +1,171 @@+---+title: "Automation Triggers"+description: "Automatically execute your CrewAI workflows when specific events occur in connected integrations"+icon: "bolt"+---++Automation triggers enable you to automatically run your CrewAI deployments when specific events occur in your connected integrations, creating powerful event-driven workflows that respond to real-time changes in your business systems.++## Overview++With automation triggers, you can:++- **Respond to real-time events** - Automatically execute workflows when specific conditions are met+- **Integrate with external systems** - Connect with platforms like Gmail, Outlook, OneDrive, JIRA, Slack, Stripe and more+- **Scale your automation** - Handle high-volume events without manual intervention+- **Maintain context** - Access trigger data within your crews and flows++## Managing Automation Triggers++### Viewing Available Triggers++To access and manage your automation triggers:++1. Navigate to your deployment in the CrewAI dashboard+2. Click on the **Triggers** tab to view all available trigger integrations++<Frame>+ <img src="/images/enterprise/list-available-triggers.png" alt="List of available automation triggers" />+</Frame>++This view shows all the trigger integrations available for your deployment, along with their current connection status.++### Enabling and Disabling Triggers++Each trigger can be easily enabled or disabled using the toggle switch:++<Frame>+ <img src="/images/enterprise/trigger-selected.png" alt="Enable or disable triggers with toggle" />+</Frame>++- **Enabled (blue toggle)**: The trigger is active and will automatically execute your deployment when the specified events occur+- **Disabled (gray toggle)**: The trigger is inactive and will not respond to events++Simply click the toggle to change the trigger state. Changes take effect immediately.++### Monitoring Trigger Executions++Track the performance and history of your triggered executions:++<Frame>+ <img src="/images/enterprise/list-executions.png" alt="List of executions triggered by automation" />+</Frame>++## Building Automation++Before building your automation, it's helpful to understand the structure of trigger payloads that your crews and flows will receive.++### Payload Samples Repository++We maintain a comprehensive repository with sample payloads from various trigger sources to help you build and test your automations:++**🔗 [CrewAI Enterprise Trigger Payload Samples](https://github.com/crewAIInc/crewai-enterprise-trigger-payload-samples)**++This repository contains:++- **Real payload examples** from different trigger sources (Gmail, Google Drive, etc.)+- **Payload structure documentation** showing the format and available fields++### Triggers with Crew++Your existing crew definitions work seamlessly with triggers, you just need to have a task to parse the received payload:++```python+@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.++### Integration with Flows++For flows, you have more control over how trigger data is handled:++#### Accessing Trigger Payload++All `@start()` methods in your flows will accept an additional parameter called `crewai_trigger_payload`:++```python+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+```++#### Triggering Crews from Flows++When kicking off a crew within a flow that was triggered, pass the trigger payload as it:++```python+@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+```++## Troubleshooting++**Trigger not firing:**+- Verify the trigger is enabled+- Check integration connection status++**Execution failures:**+- Check the execution logs for error details+- If you are developing, make sure the inputs include the `crewai_trigger_payload` parameter with the correct payload++Automation triggers transform your CrewAI deployments into responsive, event-driven systems that can seamlessly integrate with your existing business processes and tools.diff --git a/docs/images/enterprise/list-available-triggers.png b/docs/images/enterprise/list-available-triggers.pngnew file mode 100644index 000000000..1198c07f1Binary files /dev/null and b/docs/images/enterprise/list-available-triggers.png differdiff --git a/docs/images/enterprise/list-executions.png b/docs/images/enterprise/list-executions.pngnew file mode 100644index 000000000..0c5cee96eBinary files /dev/null and b/docs/images/enterprise/list-executions.png differdiff --git a/docs/images/enterprise/trigger-selected.png b/docs/images/enterprise/trigger-selected.pngnew file mode 100644index 000000000..1f8886c94Binary files /dev/null and b/docs/images/enterprise/trigger-selected.png differdiff --git a/docs/ko/enterprise/guides/automation-triggers.mdx b/docs/ko/enterprise/guides/automation-triggers.mdxnew file mode 100644index 000000000..944f74e55--- /dev/null+++ b/docs/ko/enterprise/guides/automation-triggers.mdx@@ -0,0 +1,171 @@+---+title: "자동화 트리거"+description: "연결된 통합에서 특정 이벤트가 발생할 때 CrewAI 워크플로우를 자동으로 실행합니다"+icon: "bolt"+---++자동화 트리거를 사용하면 연결된 통합에서 특정 이벤트가 발생할 때 CrewAI 배포를 자동으로 실행할 수 있어, 비즈니스 시스템의 실시간 변화에 반응하는 강력한 이벤트 기반 워크플로우를 만들 수 있습니다.++## 개요++자동화 트리거를 사용하면 다음을 수행할 수 있습니다:++- **실시간 이벤트에 응답** - 특정 조건이 충족될 때 워크플로우를 자동으로 실행+- **외부 시스템과 통합** - Gmail, Outlook, OneDrive, JIRA, Slack, Stripe 등의 플랫폼과 연결+- **자동화 확장** - 수동 개입 없이 대용량 이벤트 처리+- **컨텍스트 유지** - crew와 flow 내에서 트리거 데이터에 액세스++## 자동화 트리거 관리++### 사용 가능한 트리거 보기++자동화 트리거에 액세스하고 관리하려면:++1. CrewAI 대시보드에서 배포로 이동+2. **트리거** 탭을 클릭하여 사용 가능한 모든 트리거 통합 보기++<Frame>+ <img src="/images/enterprise/list-available-triggers.png" alt="사용 가능한 자동화 트리거 목록" />+</Frame>++이 보기는 배포에 사용 가능한 모든 트리거 통합과 현재 연결 상태를 보여줍니다.++### 트리거 활성화 및 비활성화++각 트리거는 토글 스위치를 사용하여 쉽게 활성화하거나 비활성화할 수 있습니다:++<Frame>+ <img src="/images/enterprise/trigger-selected.png" alt="토글로 트리거 활성화 또는 비활성화" />+</Frame>++- **활성화됨 (파란색 토글)**: 트리거가 활성 상태이며 지정된 이벤트가 발생할 때 배포를 자동으로 실행합니다+- **비활성화됨 (회색 토글)**: 트리거가 비활성 상태이며 이벤트에 응답하지 않습니다++토글을 클릭하기만 하면 트리거 상태를 변경할 수 있습니다. 변경 사항은 즉시 적용됩니다.++### 트리거 실행 모니터링++트리거된 실행의 성능과 기록을 추적합니다:++<Frame>+ <img src="/images/enterprise/list-executions.png" alt="자동화에 의해 트리거된 실행 목록" />+</Frame>++## 자동화 구축++자동화를 구축하기 전에 crew와 flow가 받을 트리거 페이로드의 구조를 이해하는 것이 도움이 됩니다.++### 페이로드 샘플 저장소++자동화를 구축하고 테스트하는 데 도움이 되도록 다양한 트리거 소스의 샘플 페이로드가 포함된 포괄적인 저장소를 유지 관리하고 있습니다:++**🔗 [CrewAI Enterprise 트리거 페이로드 샘플](https://github.com/crewAIInc/crewai-enterprise-trigger-payload-samples)**++이 저장소에는 다음이 포함되어 있습니다:++- **실제 페이로드 예제** - 다양한 트리거 소스(Gmail, Google Drive 등)에서 가져온 예제+- **페이로드 구조 문서** - 형식과 사용 가능한 필드를 보여주는 문서++### Crew와 트리거++기존 crew 정의는 트리거와 완벽하게 작동하며, 받은 페이로드를 분석하는 작업만 있으면 됩니다:++```python+@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(),+ )+```++crew는 자동으로 트리거 페이로드를 받고 표준 CrewAI 컨텍스트 메커니즘을 통해 액세스할 수 있습니다.++### Flow와의 통합++flow의 경우 트리거 데이터 처리 방법을 더 세밀하게 제어할 수 있습니다:++#### 트리거 페이로드 액세스++flow의 모든 `@start()` 메서드는 `crewai_trigger_payload`라는 추가 매개변수를 허용합니다:++```python+from crewai.flow import Flow, start, listen++class MyAutomatedFlow(Flow):+ @start()+ def handle_trigger(self, crewai_trigger_payload: dict = None):+ """+ 이 start 메서드는 트리거 데이터를 받을 수 있습니다+ """+ if crewai_trigger_payload:+ # 트리거 데이터 처리+ trigger_id = crewai_trigger_payload.get('id')+ event_data = crewai_trigger_payload.get('payload', {})++ # 다른 메서드에서 사용할 수 있도록 flow 상태에 저장+ self.state.trigger_id = trigger_id+ self.state.trigger_type = event_data++ return event_data++ # 수동 실행 처리+ return None++ @listen(handle_trigger)+ def process_data(self, trigger_data):+ """+ 트리거 데이터 처리+ """+ # ... 트리거 처리+```++#### Flow에서 Crew 트리거하기++트리거된 flow 내에서 crew를 시작할 때 트리거 페이로드를 전달합니다:++```python+@start()+def delegate_to_crew(self, crewai_trigger_payload: dict = None):+ """+ 전문 crew에 처리 위임+ """+ crew = MySpecializedCrew()++ # crew에 트리거 페이로드 전달+ result = crew.crew().kickoff(+ inputs={+ 'a_custom_parameter': "custom_value",+ 'crewai_trigger_payload': crewai_trigger_payload+ },+ )++ return result+```++## 문제 해결++**트리거가 작동하지 않는 경우:**+- 트리거가 활성화되어 있는지 확인+- 통합 연결 상태 확인++**실행 실패:**+- 오류 세부 정보는 실행 로그 확인+- 개발 중인 경우 입력에 올바른 페이로드가 포함된 `crewai_trigger_payload` 매개변수가 포함되어 있는지 확인++자동화 트리거는 CrewAI 배포를 기존 비즈니스 프로세스 및 도구와 완벽하게 통합할 수 있는 반응형 이벤트 기반 시스템으로 변환합니다.diff --git a/docs/pt-BR/enterprise/guides/automation-triggers.mdx b/docs/pt-BR/enterprise/guides/automation-triggers.mdxnew file mode 100644index 000000000..ebdcba9c3--- /dev/null+++ b/docs/pt-BR/enterprise/guides/automation-triggers.mdx@@ -0,0 +1,171 @@+---+title: "Triggers de Automação"+description: "Execute automaticamente seus workflows CrewAI quando eventos específicos ocorrem em integrações conectadas"+icon: "bolt"+---++Os triggers de automação permitem executar automaticamente suas implantações CrewAI quando eventos específicos ocorrem em suas integrações conectadas, criando workflows poderosos orientados por eventos que respondem a mudanças em tempo real em seus sistemas de negócio.++## Visão Geral++Com triggers de automação, você pode:++- **Responder a eventos em tempo real** - Execute workflows automaticamente quando condições específicas forem atendidas+- **Integrar com sistemas externos** - Conecte com plataformas como Gmail, Outlook, OneDrive, JIRA, Slack, Stripe e muito mais+- **Escalar sua automação** - Lide com eventos de alto volume sem intervenção manual+- **Manter contexto** - Acesse dados do trigger dentro de suas crews e flows++## Gerenciando Triggers de Automação++### Visualizando Triggers Disponíveis++Para acessar e gerenciar seus triggers de automação:++1. Navegue até sua implantação no painel do CrewAI+2. Clique na aba **Triggers** para visualizar todas as integrações de trigger disponíveis++<Frame>+ <img src="/images/enterprise/list-available-triggers.png" alt="Lista de triggers de automação disponíveis" />+</Frame>++Esta visualização mostra todas as integrações de trigger disponíveis para sua implantação, junto com seus status de conexão atuais.++### Habilitando e Desabilitando Triggers++Cada trigger pode ser facilmente habilitado ou desabilitado usando o botão de alternância:++<Frame>+ <img src="/images/enterprise/trigger-selected.png" alt="Habilitar ou desabilitar triggers com alternância" />+</Frame>++- **Habilitado (alternância azul)**: O trigger está ativo e executará automaticamente sua implantação quando os eventos especificados ocorrerem+- **Desabilitado (alternância cinza)**: O trigger está inativo e não responderá a eventos++Simplesmente clique na alternância para mudar o estado do trigger. As alterações entram em vigor imediatamente.++### Monitorando Execuções de Trigger++Acompanhe o desempenho e histórico de suas execuções acionadas:++<Frame>+ <img src="/images/enterprise/list-executions.png" alt="Lista de execuções acionadas por automação" />+</Frame>++## Construindo Automação++Antes de construir sua automação, é útil entender a estrutura dos payloads de trigger que suas crews e flows receberão.++### Repositório de Amostras de Payload++Mantemos um repositório abrangente com amostras de payload de várias fontes de trigger para ajudá-lo a construir e testar suas automações:++**🔗 [Amostras de Payload de Trigger CrewAI Enterprise](https://github.com/crewAIInc/crewai-enterprise-trigger-payload-samples)**++Este repositório contém:++- **Exemplos reais de payload** de diferentes fontes de trigger (Gmail, Google Drive, etc.)+- **Documentação da estrutura de payload** mostrando o formato e campos disponíveis++### Triggers com Crew++Suas definições de crew existentes funcionam perfeitamente com triggers, você só precisa ter uma tarefa para analisar o payload recebido:++```python+@CrewBase+class MinhaCrewAutomatizada:+ @agent+ def pesquisador(self) -> Agent:+ return Agent(+ config=self.agents_config['pesquisador'],+ )++ @task+ def analisar_payload_trigger(self) -> Task:+ return Task(+ config=self.tasks_config['analisar_payload_trigger'],+ agent=self.pesquisador(),+ )++ @task+ def analisar_conteudo_trigger(self) -> Task:+ return Task(+ config=self.tasks_config['analisar_dados_trigger'],+ agent=self.pesquisador(),+ )+```++A crew receberá automaticamente e pode acessar o payload do trigger através dos mecanismos de contexto padrão do CrewAI.++### Integração com Flows++Para flows, você tem mais controle sobre como os dados do trigger são tratados:++#### Acessando Payload do Trigger++Todos os métodos `@start()` em seus flows aceitarão um parâmetro adicional chamado `crewai_trigger_payload`:++```python+from crewai.flow import Flow, start, listen++class MeuFlowAutomatizado(Flow):+ @start()+ def lidar_com_trigger(self, crewai_trigger_payload: dict = None):+ """+ Este método start pode receber dados do trigger+ """+ if crewai_trigger_payload:+ # Processa os dados do trigger+ trigger_id = crewai_trigger_payload.get('id')+ dados_evento = crewai_trigger_payload.get('payload', {})++ # Armazena no estado do flow para uso por outros métodos+ self.state.trigger_id = trigger_id+ self.state.trigger_type = dados_evento++ return dados_evento++ # Lida com execução manual+ return None++ @listen(lidar_com_trigger)+ def processar_dados(self, dados_trigger):+ """+ Processa os dados do trigger+ """+ # ... processa o trigger+```++#### Acionando Crews a partir de Flows++Ao iniciar uma crew dentro de um flow que foi acionado, passe o payload do trigger conforme ele:++```python+@start()+def delegar_para_crew(self, crewai_trigger_payload: dict = None):+ """+ Delega processamento para uma crew especializada+ """+ crew = MinhaCrewEspecializada()++ # Passa o payload do trigger para a crew+ resultado = crew.crew().kickoff(+ inputs={+ 'parametro_personalizado': "valor_personalizado",+ 'crewai_trigger_payload': crewai_trigger_payload+ },+ )++ return resultado+```++## Solução de Problemas++**Trigger não está sendo disparado:**+- Verifique se o trigger está habilitado+- Verifique o status de conexão da integração++**Falhas de execução:**+- Verifique os logs de execução para detalhes do erro+- Se você está desenvolvendo, certifique-se de que as entradas incluem o parâmetro `crewai_trigger_payload` com o payload correto++Os triggers de automação transformam suas implantações CrewAI em sistemas responsivos orientados por eventos que podem se integrar perfeitamente com seus processos de negócio e ferramentas existentes.