Automations and collaboration integrations
Automations let Nao perform a saved request without an interactive user turn. They start from a schedule, webhook, product event, or manual action, use the project’s agent context, and send the result to configured destinations such as email, Slack, or GitHub. Collaboration integrations also let people start or continue Nao conversations from shared messaging tools.
Automation workflows
Automation triggers
An automation is a saved prompt with one or more event sources. A schedule starts recurring runs, a webhook lets an authorized external system start a run, a feedback event can respond to selected feedback sources and votes, and a manual action starts a run from the product. An automation must have at least one trigger, so every saved automation has a clear way to begin.
The trigger path checks that the automation belongs to the project and that the relevant access rules allow it to run. A scheduled automation can be paused through its scheduled job. An automation without a schedule uses its webhook or event triggers as its active switch. Chat-feedback triggers are limited to users with the required project role.
This diagram shows how time, external requests, product feedback, and manual actions enter the same automation run path.
flowchart LR
A[Schedule] --> E[Automation run]
B[Authorized webhook] --> E
C[Feedback event] --> E
D[Manual run] --> E
E --> F[Project-aware Nao agent]
F --> G[Chat record and run feed]
F --> H[Configured outbound integrations]
See Automation workflows for the run lifecycle and trigger rules.
References: apps/…/automation.routes.ts• L111-127 apps/…/automation.routes.ts• L171-196 apps/…/automation.routes.ts• L214-232 apps/…/automation.routes.ts• L254-264 apps/…/automation.routes.ts• L395-410 apps/…/automation.routes.ts• L476-501 apps/…/automation-webhook.ts• L16-64
Automation access and sharing
Automation access controls determine which project members can find an automation and which actions they can take. The owner or a project admin can share an automation with the whole project or with selected users and groups, using viewer or editor rights; an automation can return to private owner access when all shares are removed.
Sharing does not replace the project boundary. New recipients must be valid project users or groups, and a person must have project access before they can own or manage an automation. This lets teams share useful event-driven work without making the underlying project available to an unrelated user.
References: apps/…/automation.routes.ts• L342-356 apps/…/automation.routes.ts• L375-405 apps/…/automation.routes.ts• L440-451 apps/…/automation-share.service.ts• L31-83 apps/…/automation-share.service.ts• L85-100
Automation execution
An automation run is a non-interactive agent task. Nao investigates the saved request with the project’s available data and tools, prepares a result, and records the work in a chat linked to the run. The chat gives the product a durable view of progress and history even when no person is watching the run.
Configured outbound integrations turn the result into an external action. Email and Slack delivery tools are required to complete a run when enabled. GitHub exposes read access for context and selected write actions such as issue creation, pull request creation, or comments. The run records each integration result so the feed can show where delivery succeeded or failed.
References: apps/…/automation.handler.ts• L71-85 apps/…/automation.handler.ts• L108-204 apps/…/automation.ts• L5-32 apps/…/github-automation-tools.ts• L31-75
Outbound delivery
Outbound delivery carries an automation’s useful result to people or work systems outside the run chat. Email can include generated visuals and story files. Slack can deliver to several channels and keep a report in one thread. GitHub actions change the selected repositories only when the matching action is enabled.
The automation prompt makes delivery part of the task rather than a side effect of the final text. When an outbound integration is enabled, Nao must call its delivery tool; otherwise the run is not considered complete.
References: apps/…/automation-run-prompt.tsx• L21-69 apps/…/automation-tools.ts• L96-127 apps/…/automation-tools.ts• L140-185 apps/…/automation-tools.ts• L189-356
Collaboration channels
Channel adapter model
A collaboration channel is an external messaging service that gives users another entry point to Nao. Each connected project has a channel adapter that receives messages or interactions, maps them to a project chat, streams the answer back, and preserves the thread as conversation context.
The settings surface presents Slack, Microsoft Teams, Telegram, WhatsApp, Mattermost, and Discord as project integrations. Their identity checks differ by service, but the product goal is the same: only an authorized project user can use Nao through the connected channel.
See Messaging channel integrations for adapter-specific behavior and setup flows.
References: apps/…/integrations.ts• L14-61 apps/…/integrations.ts• L64-119 apps/…/slack.ts• L136-179 apps/…/discord.ts• L84-107
Interactive channel conversations
Channel messages become normal Nao conversations after the adapter resolves the sender, checks project access, and links the external thread to a chat. Nao then streams progress and the answer back into that same conversation. Users can stop generation and, where the channel supports it, give feedback on the answer.
The channel is therefore both an input and a context surface. Existing threads can supply earlier messages to the agent, while charts, maps, files, and links can return through the channel or point back to the full answer in Nao.
References: apps/…/slack.ts• L469-494 apps/…/slack.ts• L593-653 apps/…/slack.ts• L1075-1105 apps/…/discord.ts• L225-262 apps/…/discord.ts• L264-314
Channel identity and access
External channel identities must map to Nao users before a message can use project data. Slack can resolve a user by email and may provision an allowed domain. Discord, Telegram, and WhatsApp use account-link flows because the channel does not always provide a usable Nao identity. Teams and Mattermost resolve the sender through their own account data and project membership.
This boundary keeps a shared channel from becoming an anonymous project entry point. An unlinked or unauthorized person receives a link, code prompt, or access error instead of an agent answer.
References: apps/…/slack.ts• L1013-1068 apps/…/discord.ts• L316-398 apps/…/telegram.ts• L175-220 apps/…/whatsapp.ts• L167-218 apps/…/teams.ts• L194-223 apps/…/mattermost.ts• L159-180
Channel notifications
Notifications are a separate delivery path from interactive channel conversations. They can create an in-app notice, send email, or send a Slack direct message with a link and supported files. Recipient preferences and unsubscribe scope can suppress email or Slack delivery without changing the underlying project event.
This path is useful when Nao needs to bring a user back to a stored chat or project event. It does not require the recipient to start a new agent turn in the external channel.
References: apps/…/notification-channels.ts• L15-41 apps/…/notification-channels.ts• L43-91 apps/…/notification-channels.ts• L94-150
System relationships
Automation and channel boundary
Automations and collaboration channels share the project-aware agent, chat history, access checks, and billing boundary, but they serve different interaction patterns. An automation starts from an event and delivers outward. A channel conversation starts from a person and returns an answer into the conversation.
The same Slack connection can support both patterns: users can ask Nao in Slack, while an automation can publish a report to a configured Slack thread. Feedback from a channel answer can also start an automation when its source and vote match the automation’s event trigger. The run record and linked chat keep those paths distinct while allowing each to point people to the durable Nao context.
References: apps/…/automation.handler.ts• L120-164 apps/…/automation-tools.ts• L207-356 apps/…/slack.ts• L217-256 apps/…/slack.ts• L593-640 apps/…/automation.routes.ts• L111-120
Change checklist
When these files or sections are changed, remember to consider these:
- Keep trigger validation, scheduled-job state, webhook pause behavior, and event-trigger state aligned. A change in one can make an automation appear active while every trigger is blocked.
- Keep feedback source and vote checks aligned with the roles allowed to create those triggers. A mismatch can expose chat feedback as a trigger to an unauthorized owner.
- Keep automation share roles aligned with the project access rules and ownership actions. A mismatch can let a viewer edit a run or let an inaccessible user become an owner.
- Keep enabled integration settings aligned with the tools advertised in the automation prompt and the results extracted from the run. A mismatch can mark a valid delivery as missing or accept a run without delivery.
- Keep channel identity linking and project-role checks aligned across each adapter. A new identity path must not bypass project membership.
- Keep external thread identifiers aligned with chat links and notification URLs. A format change can split one conversation into several chats or send users to the wrong context.
- Keep the shared integration list aligned with project settings and the adapter routes. A listed channel that has no working entry point creates a false connected state.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| An automation has neither a schedule, webhook, nor enabled event trigger | It cannot be created or updated | Validate that at least one trigger is enabled |
| A scheduled automation is paused | Its schedule, webhook, and event triggers do not start runs | Treat the scheduled job state as the active state |
| An unscheduled automation has event triggers disabled while its webhook state is derived from those triggers | Its configured event sources can be inactive even when the automation appears available | Reconcile event-trigger and webhook state when changing active status |
| A webhook uses a key from another organization | The automation is hidden and no run starts | Check API-key organization ownership before enqueueing |
| A chat-feedback trigger is created by a role without feedback-trigger access | The automation cannot use chat feedback as an event source | Enforce the role check when saving the trigger |
| An automation is shared with a user or group outside the project access rules | The recipient can see an automation without a valid project boundary | Validate new users and groups before replacing the share list |
| Nao finishes without calling an enabled required integration | The run is marked failed even if the analysis text exists | Compare required integration tools with the recorded tool results |
| A channel user is unlinked or lacks project access | Nao does not expose project data or answer the request | Resolve the external identity and check its project role first |
| A channel answer exceeds the external service limit | The channel shows a shortened answer or a link instead of the full result | Use the channel’s overflow or fallback delivery path |
Key files
| File | Why to read it |
|---|---|
| apps/…/automation.routes.ts | Shows how automations select schedule, webhook, feedback, and manual triggers, configure integrations, manage sharing, and start or pause runs. |
| apps/…/automation-webhook.ts | Shows the authenticated external trigger boundary. |
| apps/…/automation.handler.ts | Shows how a trigger becomes a project-aware run, linked chat, and integration result. |
| apps/…/automation-run-prompt.tsx | Shows the product contract that makes outbound delivery part of automation success. |
| apps/…/automation-tools.ts | Shows the shared delivery surface for email and Slack. |
| apps/…/github-automation-tools.ts | Shows how GitHub context and write actions are scoped to an automation. |
| apps/…/automation-share.service.ts | Shows how automation visibility, user and group grants, and owner or admin sharing rights are managed. |
| apps/…/integrations.ts | Shows the collaboration channels exposed as project integrations and their connection summaries. |
| apps/…/slack.ts | Shows the Slack conversation, thread, identity, and answer-delivery boundary. |
| apps/…/discord.ts | Shows Discord account linking, message handling, and answer feedback. |
| apps/…/notification-channels.ts | Shows the separate in-app, email, and Slack notification delivery path. |