# prismatic-io/examples architecture

> Architecture diagram of the GitHub repository prismatic-io/examples, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/prismatic-io/examples
- Repository: https://github.com/prismatic-io/examples

## Overview

#### 1. Repository Role and Layout
This is a collection of independent Prismatic examples, not one deployable application. It demonstrates custom components, low-code/YAML integrations, Code-Native Integrations (CNIs), GraphQL/API automation, and AI-agent patterns. Primary top-level domains are `components/`, `integrations/`, `api/`, and `ai/`.

#### 2. Prismatic Component Packages
`components/` contains separately buildable TypeScript component packages that expose reusable actions, triggers, connection definitions, inputs, and data sources to Prismatic. Each component’s `src/index.ts` is its registration boundary; actions delegate to service-specific clients and authentication definitions.
- `components/asana/src/index.ts`
- `components/asana/src/client.ts`
- `components/aws-s3/src/index.ts`
- `components/slack/src/index.ts`

Flow: Prismatic runtime invokes a component action/trigger → component resolves configured connection/input values → API client calls the external service → normalized result is returned to an integration flow.

#### 3. Integration Definitions and CNIs
`integrations/` supplies declarative YAML examples for low-code workflows and TypeScript CNIs for custom workflow behavior. YAML files define integration orchestration; CNI projects register component dependencies, configuration pages, and named flows through a package entry point.
- `integrations/salesforce-example.yml`
- `integrations/code-native-integrations/gong/src/index.ts`
- `integrations/code-native-integrations/gong/src/flows/getTranscripts.ts`
- `integrations/code-native-integrations/outlook/src/services/graphClient.ts`

The key boundary is between Prismatic-managed execution/configuration and custom TypeScript flow code. CNIs commonly isolate third-party HTTP clients under `src/services/` while `src/flows/` implements business workflow steps.

#### 4. AI Agent Integrations
`ai/` contains integration packages that combine OpenAI agent behavior with Prismatic-hosted integrations and third-party systems. The comprehensive agent reference exposes several flow entry points, tool adapters, and a Prismatic API/auth client layer.
- `ai/openai-agent/src/index.ts`
- `ai/openai-agent/src/flows/index.ts`
- `ai/openai-agent/src/agents/tools/prismaticHostedTools.ts`
- `ai/openai-agent/src/prismatic/client/graphql.ts`

Typical control flow: inbound chat/event → selected agent flow → model tool selection → OpenAI-hosted tool, REST API, or Prismatic integration execution → optional human approval → stateful response. External boundaries include OpenAI, Prismatic GraphQL/API services, and customer-specific deployed integrations.

#### 5. Slack and Web Chat Entry Points
Two examples expose user-facing interaction adapters. The Slack agent receives and quickly acknowledges Slack webhooks, filters bot-originated messages, tracks thread state, and dispatches agent execution; Slack Block UI supports approvals. The Next.js app offers browser routes and server API routes for chat, Prismatic authentication, and tool discovery.
- `ai/slack-chatbot-agent/src/flows/eventHandler.ts`
- `ai/slack-chatbot-agent/src/slack/webhookReceiver.ts`
- `ai/nextjs-chatbot/src/app/api/chat/route.ts`
- `ai/nextjs-chatbot/src/app/ai-chat/page.tsx`

Runtimes are Node.js/TypeScript; the chat frontend additionally uses Next.js. Slack’s acknowledgement-time requirement is an important ingress boundary before longer agent work.

#### 6. Prismatic API Automation Utilities
`api/` contains standalone scripts/services for operating Prismatic organizations, integrations, instances, executions, and alert monitors through GraphQL or related APIs. These are administrative automation examples rather than shared platform services.
- `api/backup-integrations-and-instances/src/index.ts`
- `api/backup-integrations-and-instances/src/exportData.ts`
- `api/replay-failed-executions/index.ts`
- `api/handle-event-webhooks/src/server.ts`

The webhook example is the clearest server-shaped utility: its HTTP server receives events, persists/coordinates through a database abstraction, and uses a Prismatic client to process them.
- `api/handle-event-webhooks/src/handleEvents.ts`
- `api/handle-event-webhooks/src/database.ts`
- `api/handle-event-webhooks/src/prismatic.ts`

#### 7. Infrastructure and Shared Patterns
Most projects are isolated npm/TypeScript packages with their own `package.json`, TypeScript configuration, and bundler configuration. External infrastructure demonstrated includes Prismatic’s integration runtime and GraphQL API, OpenAI Agent SDK/hosted tools, Slack, Salesforce, Dropbox, Jira, Microsoft Graph, AWS, and other SaaS APIs. AWS-specific shared connection, AssumeRole, credential, and region handling is centralized only within:
- `packages/aws-utils/src/index.ts`
- `packages/aws-utils/src/connection/assumeRoleConnection.ts`
- `packages/aws-utils/src/helpers/getCredentials.ts`

Main entry points: [`ai/openai-agent/src/flows/index.ts`](https://github.com/prismatic-io/examples/blob/main/ai/openai-agent/src/flows/index.ts) (Agent flows), [`components/asana/src/index.ts`](https://github.com/prismatic-io/examples/blob/main/components/asana/src/index.ts) (Component registrations), [`components/asana/src/client.ts`](https://github.com/prismatic-io/examples/blob/main/components/asana/src/client.ts) (Service API clients), [`integrations/code-native-integrations/gong/src/index.ts`](https://github.com/prismatic-io/examples/blob/main/integrations/code-native-integrations/gong/src/index.ts) (Gong CNI registration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_components["Component packages"]
  node_component_registrations["Component registrations<br/>TypeScript packages<br/>[index.ts]"]
  node_component_clients["Service API clients<br/>component client<br/>[client.ts]"]
  node_aws_utils["AWS connection utilities<br/>shared TypeScript library<br/>[index.ts]"]
end

subgraph group_integrations["Integration definitions"]
  node_yaml_integrations["YAML integrations<br/>declarative workflows"]
  node_gong_cni["Gong CNI registration<br/>code-native integration<br/>[index.ts]"]
  node_gong_flow["Transcript flow<br/>CNI workflow step<br/>[getTranscripts.ts]"]
  node_graph_client["Microsoft Graph client<br/>HTTP client<br/>[graphClient.ts]"]
end

subgraph group_ai["AI agent examples"]
  node_openai_agent_entry["OpenAI agent entry<br/>agent integration<br/>[index.ts]"]
  node_agent_flows["Agent flows<br/>agent orchestration<br/>[index.ts]"]
  node_prismatic_hosted_tools["Prismatic hosted tools<br/>tool adapter"]
  node_agent_graphql_client["Agent GraphQL client<br/>Prismatic client<br/>[graphql.ts]"]
  node_slack_webhook["Slack webhook receiver<br/>Slack ingress<br/>[webhookReceiver.ts]"]
  node_slack_event_flow["Slack event handler<br/>agent dispatch flow<br/>[eventHandler.ts]"]
  node_nextjs_chat["Next.js chat UI/API<br/>web chat application<br/>[route.ts]"]
end

subgraph group_api["API automation"]
  node_event_webhook_server["Event webhook server<br/>HTTP automation utility<br/>[server.ts]"]
  node_event_processor["Event processing and storage<br/>webhook processing layer<br/>[handleEvents.ts]"]
  node_backup_export["Backup/export utility<br/>admin script<br/>[exportData.ts]"]
end

node_prismatic_runtime{{"Prismatic runtime<br/>managed runtime"}}
node_prismatic_api{{"Prismatic GraphQL/API<br/>external API"}}
node_saas_apis{{"SaaS provider APIs<br/>external services"}}
node_openai{{"OpenAI Agent SDK/tools<br/>external AI service"}}

node_prismatic_runtime -->|"invokes actions/triggers"| node_component_registrations
node_component_registrations -->|"delegates API calls"| node_component_clients
node_component_registrations -.->|"uses AWS auth helpers"| node_aws_utils
node_component_clients -->|"calls"| node_saas_apis
node_prismatic_runtime -->|"executes"| node_yaml_integrations
node_prismatic_runtime -->|"executes"| node_gong_cni
node_gong_cni -->|"registers"| node_gong_flow
node_gong_flow -.->|"uses service clients"| node_graph_client
node_graph_client -->|"calls Microsoft Graph"| node_saas_apis
node_prismatic_runtime -->|"executes"| node_openai_agent_entry
node_openai_agent_entry -->|"registers"| node_agent_flows
node_agent_flows -->|"selects model tools"| node_openai
node_agent_flows -->|"invokes"| node_prismatic_hosted_tools
node_prismatic_hosted_tools -->|"executes hosted integrations"| node_prismatic_api
node_agent_flows -->|"uses"| node_agent_graphql_client
node_agent_graphql_client -->|"queries and authenticates"| node_prismatic_api
node_slack_webhook -->|"acknowledges then dispatches"| node_slack_event_flow
node_slack_event_flow -->|"starts agent work"| node_agent_flows
node_nextjs_chat -->|"submits chat requests"| node_agent_flows
node_event_webhook_server -->|"forwards received events"| node_event_processor
node_event_processor -->|"processes events"| node_prismatic_api
node_backup_export -->|"exports organization data"| node_prismatic_api

click node_component_registrations "https://github.com/prismatic-io/examples/blob/main/components/asana/src/index.ts"
click node_component_clients "https://github.com/prismatic-io/examples/blob/main/components/asana/src/client.ts"
click node_aws_utils "https://github.com/prismatic-io/examples/blob/main/packages/aws-utils/src/index.ts"
click node_yaml_integrations "https://github.com/prismatic-io/examples/blob/main/integrations/salesforce-example.yml"
click node_gong_cni "https://github.com/prismatic-io/examples/blob/main/integrations/code-native-integrations/gong/src/index.ts"
click node_gong_flow "https://github.com/prismatic-io/examples/blob/main/integrations/code-native-integrations/gong/src/flows/getTranscripts.ts"
click node_graph_client "https://github.com/prismatic-io/examples/blob/main/integrations/code-native-integrations/outlook/src/services/graphClient.ts"
click node_openai_agent_entry "https://github.com/prismatic-io/examples/blob/main/ai/openai-agent/src/index.ts"
click node_agent_flows "https://github.com/prismatic-io/examples/blob/main/ai/openai-agent/src/flows/index.ts"
click node_prismatic_hosted_tools "https://github.com/prismatic-io/examples/blob/main/ai/openai-agent/src/agents/tools/prismaticHostedTools.ts"
click node_agent_graphql_client "https://github.com/prismatic-io/examples/blob/main/ai/openai-agent/src/prismatic/client/graphql.ts"
click node_slack_webhook "https://github.com/prismatic-io/examples/blob/main/ai/slack-chatbot-agent/src/slack/webhookReceiver.ts"
click node_slack_event_flow "https://github.com/prismatic-io/examples/blob/main/ai/slack-chatbot-agent/src/flows/eventHandler.ts"
click node_nextjs_chat "https://github.com/prismatic-io/examples/blob/main/ai/nextjs-chatbot/src/app/api/chat/route.ts"
click node_event_webhook_server "https://github.com/prismatic-io/examples/blob/main/api/handle-event-webhooks/src/server.ts"
click node_event_processor "https://github.com/prismatic-io/examples/blob/main/api/handle-event-webhooks/src/handleEvents.ts"
click node_backup_export "https://github.com/prismatic-io/examples/blob/main/api/backup-integrations-and-instances/src/exportData.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_component_registrations,node_component_clients,node_aws_utils toneBlue
class node_yaml_integrations,node_gong_cni,node_gong_flow,node_graph_client toneAmber
class node_openai_agent_entry,node_agent_flows,node_prismatic_hosted_tools,node_agent_graphql_client,node_slack_webhook,node_slack_event_flow,node_nextjs_chat toneMint
class node_event_webhook_server,node_event_processor,node_backup_export toneRose
class node_prismatic_runtime,node_prismatic_api,node_saas_apis,node_openai toneNeutral
```

## Components

### Component packages

Reusable TypeScript extensions for Prismatic.

- [Component registrations](https://github.com/prismatic-io/examples/blob/main/components/asana/src/index.ts): TypeScript packages · Exports actions, triggers, connections, inputs, and data sources. · `components/asana/src/index.ts`
- [Service API clients](https://github.com/prismatic-io/examples/blob/main/components/asana/src/client.ts): component client · Resolves authentication and calls provider APIs. · `components/asana/src/client.ts`
- [AWS connection utilities](https://github.com/prismatic-io/examples/blob/main/packages/aws-utils/src/index.ts): shared TypeScript library · Centralizes AssumeRole, credentials, and region handling. · `packages/aws-utils/src/index.ts`

### Integration definitions

Low-code YAML and code-native workflows.

- [YAML integrations](https://github.com/prismatic-io/examples/blob/main/integrations/salesforce-example.yml): declarative workflows · Prismatic-managed low-code orchestration. · `integrations/salesforce-example.yml`
- [Gong CNI registration](https://github.com/prismatic-io/examples/blob/main/integrations/code-native-integrations/gong/src/index.ts): code-native integration · Registers dependencies, configuration, and named flows. · `integrations/code-native-integrations/gong/src/index.ts`
- [Transcript flow](https://github.com/prismatic-io/examples/blob/main/integrations/code-native-integrations/gong/src/flows/getTranscripts.ts): CNI workflow step · Implements custom transcript workflow behavior. · `integrations/code-native-integrations/gong/src/flows/getTranscripts.ts`
- [Microsoft Graph client](https://github.com/prismatic-io/examples/blob/main/integrations/code-native-integrations/outlook/src/services/graphClient.ts): HTTP client · Isolates third-party API access for an Outlook CNI. · `integrations/code-native-integrations/outlook/src/services/graphClient.ts`

### AI agent examples

Agent flows and chat interaction adapters.

- [OpenAI agent entry](https://github.com/prismatic-io/examples/blob/main/ai/openai-agent/src/index.ts): agent integration · Registers the agent integration and flow entry points. · `ai/openai-agent/src/index.ts`
- [Agent flows](https://github.com/prismatic-io/examples/blob/main/ai/openai-agent/src/flows/index.ts): agent orchestration · Selects and coordinates agent behavior per request. · `ai/openai-agent/src/flows/index.ts`
- [Prismatic hosted tools](https://github.com/prismatic-io/examples/blob/main/ai/openai-agent/src/agents/tools/prismaticHostedTools.ts): tool adapter · Lets agents invoke hosted integrations. · `ai/openai-agent/src/agents/tools/prismaticHostedTools.ts`
- [Agent GraphQL client](https://github.com/prismatic-io/examples/blob/main/ai/openai-agent/src/prismatic/client/graphql.ts): Prismatic client · Provides authenticated Prismatic API access. · `ai/openai-agent/src/prismatic/client/graphql.ts`
- [Slack webhook receiver](https://github.com/prismatic-io/examples/blob/main/ai/slack-chatbot-agent/src/slack/webhookReceiver.ts): Slack ingress · Acknowledges Slack events before longer processing. · `ai/slack-chatbot-agent/src/slack/webhookReceiver.ts`
- [Slack event handler](https://github.com/prismatic-io/examples/blob/main/ai/slack-chatbot-agent/src/flows/eventHandler.ts): agent dispatch flow · Filters bot messages, tracks threads, and dispatches agents. · `ai/slack-chatbot-agent/src/flows/eventHandler.ts`
- [Next.js chat UI/API](https://github.com/prismatic-io/examples/blob/main/ai/nextjs-chatbot/src/app/api/chat/route.ts): web chat application · Browser chat route and server API route for agent chat. · `ai/nextjs-chatbot/src/app/api/chat/route.ts`

### API automation

Standalone Prismatic administration utilities.

- [Event webhook server](https://github.com/prismatic-io/examples/blob/main/api/handle-event-webhooks/src/server.ts): HTTP automation utility · Receives Prismatic event webhooks and coordinates processing. · `api/handle-event-webhooks/src/server.ts`
- [Event processing and storage](https://github.com/prismatic-io/examples/blob/main/api/handle-event-webhooks/src/handleEvents.ts): webhook processing layer · Persists/coordinates events and calls Prismatic. · `api/handle-event-webhooks/src/handleEvents.ts`
- [Backup/export utility](https://github.com/prismatic-io/examples/blob/main/api/backup-integrations-and-instances/src/exportData.ts): admin script · Exports integration and instance data through Prismatic APIs. · `api/backup-integrations-and-instances/src/exportData.ts`

### Other components

- **Prismatic runtime**: managed runtime · Executes integrations, components, and deployed flows.
- **Prismatic GraphQL/API**: external API · Management and integration execution boundary.
- **SaaS provider APIs**: external services · Includes Asana, Slack, AWS, and other component targets.
- **OpenAI Agent SDK/tools**: external AI service

## Connections

- Prismatic runtime → Component registrations: invokes actions/triggers
- Component registrations → Service API clients: delegates API calls
- Component registrations → AWS connection utilities: uses AWS auth helpers
- Service API clients → SaaS provider APIs: calls
- Prismatic runtime → YAML integrations: executes
- Prismatic runtime → Gong CNI registration: executes
- Gong CNI registration → Transcript flow: registers
- Transcript flow → Microsoft Graph client: uses service clients
- Microsoft Graph client → SaaS provider APIs: calls Microsoft Graph
- Prismatic runtime → OpenAI agent entry: executes
- OpenAI agent entry → Agent flows: registers
- Agent flows → OpenAI Agent SDK/tools: selects model tools
- Agent flows → Prismatic hosted tools: invokes
- Prismatic hosted tools → Prismatic GraphQL/API: executes hosted integrations
- Agent flows → Agent GraphQL client: uses
- Agent GraphQL client → Prismatic GraphQL/API: queries and authenticates
- Slack webhook receiver → Slack event handler: acknowledges then dispatches
- Slack event handler → Agent flows: starts agent work
- Next.js chat UI/API → Agent flows: submits chat requests
- Event webhook server → Event processing and storage: forwards received events
- Event processing and storage → Prismatic GraphQL/API: processes events
- Backup/export utility → Prismatic GraphQL/API: exports organization data
