diff --git a/README.md b/README.md index adaa72d7..d42d8244 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,7 @@ demonstrate basic system features, integration APIs, and best practices. | [Google Sheets to SOAP Calculator](./sheets_to_soap/)
[![Start with AutoKitteh](https://autokitteh.com/assets/autokitteh-badge.svg)](https://app.autokitteh.cloud/template?name=sheets_to_soap) | Reads numeric values from Google Sheets and sends them to a SOAP-based calculator API | googlesheets | | [AI-driven Slack bot for assistance requests](./slack_support/)
[![Start with AutoKitteh](https://autokitteh.com/assets/autokitteh-badge.svg)](https://app.autokitteh.cloud/template?name=slack_support) | Automatically route help requests to the right expert based on topic analysis and expertise matching | slack, googlesheets, googlegemini | | [Fault tolerant workflow with manual Slack approvals](./task_chain/single_workflow/basic/)
[![Start with AutoKitteh](https://autokitteh.com/assets/autokitteh-badge.svg)](https://app.autokitteh.cloud/template?name=task_chain/single_workflow/basic) | Runs a sequence of tasks with fault tolerance. In case of failure, user can decide to terminate or retry from the point of failure. | slack | +| [Google Sheets Notifications](./walkthroughs/get_google_sheets_notifications/)
[![Start with AutoKitteh](https://autokitteh.com/assets/autokitteh-badge.svg)](https://app.autokitteh.cloud/template?name=walkthroughs/get_google_sheets_notifications) | detects and responds to changes in Google Sheets documents | googledrive | | [Gmail new email notification](./walkthroughs/new_gmail_notification/)
[![Start with AutoKitteh](https://autokitteh.com/assets/autokitteh-badge.svg)](https://app.autokitteh.cloud/template?name=walkthroughs/new_gmail_notification) | Poll for new emails in Gmail inbox and handle them with custom logic | gmail | | [Create Jira ticket from webhook data](./webhook_to_jira/)
[![Start with AutoKitteh](https://autokitteh.com/assets/autokitteh-badge.svg)](https://app.autokitteh.cloud/template?name=webhook_to_jira) | Create Jira issues automatically from HTTP webhooks | jira | | [WhatsApp ChatGPT Bot](./whatsapp_chatbot/)
[![Start with AutoKitteh](https://autokitteh.com/assets/autokitteh-badge.svg)](https://app.autokitteh.cloud/template?name=whatsapp_chatbot) | WhatsApp chatbot that responds to messages using ChatGPT intelligence | twilio, chatgpt | diff --git a/walkthroughs/get_google_sheets_notifications/README.md b/walkthroughs/get_google_sheets_notifications/README.md new file mode 100644 index 00000000..d61d2cea --- /dev/null +++ b/walkthroughs/get_google_sheets_notifications/README.md @@ -0,0 +1,43 @@ +--- +title: Google Sheets Notifications +description: detects and responds to changes in Google Sheets documents +integrations: ["googledrive"] +categories: ["Productivity", "Reliability"] +tags: ["google sheets events", "file_monitoring", "notifications"] +--- + +# Google Sheets Notifications + +This project detects when Google Sheets documents are edited and processes those change events. + +This project monitors spreadsheet change by integrating Google Drive to track file modifications and filter for Google Sheets documents specifically. + +API documentation: + +- Google Drive: https://docs.autokitteh.com/integrations/google/drive + +## How It Works + +1. Monitor Google Drive for a spread sheet change events +2. Log the file ID and change details + +## Cloud Usage + +1. Initialize your connection (Google Drive) +2. Deploy project + +## Trigger Workflow + +> [!IMPORTANT] +> Ensure all connections (Google Drive) are initialized; otherwise, the workflow will raise a `ConnectionInitError`. + +The workflow is triggered via Google Drive when files are modified. The system filters these events to only process changes to Google Sheets documents. + +## Self-Hosted Deployment + +Follow [these detailed instructions](https://docs.autokitteh.com/get_started/deployment) to deploy the project on a self-hosted server. + +## Known Limitations + +- Only change events for files created by or explicitly shared with the app are triggered when using the `drive.file` scope. +- Does not track creation or deletion of spreadsheets diff --git a/walkthroughs/get_google_sheets_notifications/autokitteh.yaml b/walkthroughs/get_google_sheets_notifications/autokitteh.yaml new file mode 100644 index 00000000..ceb8b912 --- /dev/null +++ b/walkthroughs/get_google_sheets_notifications/autokitteh.yaml @@ -0,0 +1,18 @@ +# This YAML file is a declarative manifest that describes +# a project that triggers events when a Google Sheets document is edited. + +version: v1 + +project: + name: gmail + + connections: + - name: drive_conn + integration: googledrive + + triggers: + - name: on_file_change + event_type: file_change + connection: drive_conn + call: program.py:on_spreadsheet_change + filter: data.file.mime_type == 'application/vnd.google-apps.spreadsheet' diff --git a/walkthroughs/get_google_sheets_notifications/program.py b/walkthroughs/get_google_sheets_notifications/program.py new file mode 100644 index 00000000..8dc7964d --- /dev/null +++ b/walkthroughs/get_google_sheets_notifications/program.py @@ -0,0 +1,8 @@ +"""walkthrough on how to get notifications a spreadsheet is edited.""" + + +def on_spreadsheet_change(event): + """Handle the event when a spreadsheet is edited.""" + file_id = event.data.get("file", {}).get("id") + print(f"spreadsheet with the ID ({file_id}) ") + print("was edited")