How prismatic-io/examples works
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: flows/index.ts Agent flows · src/index.ts Component registrations · client.ts Service API clients · src/index.ts Gong CNI registration
Components 21
Component packages
Reusable TypeScript extensions for Prismatic.
- Component registrations · Exports actions, triggers, connections, inputs, and data sources.
components/asana/src/index.ts - Service API clients · Resolves authentication and calls provider APIs.
components/asana/src/client.ts - AWS connection utilities · Centralizes AssumeRole, credentials, and region handling.
packages/aws-utils/src/index.ts
Integration definitions
Low-code YAML and code-native workflows.
- YAML integrations · Prismatic-managed low-code orchestration.
integrations/salesforce-example.yml - Gong CNI registration · Registers dependencies, configuration, and named flows.
integrations/code-native-integrations/gong/src/index.ts - Transcript flow · Implements custom transcript workflow behavior.
integrations/code-native-integrations/gong/src/flows/getTranscripts.ts - Microsoft Graph 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 · Registers the agent integration and flow entry points.
ai/openai-agent/src/index.ts - Agent flows · Selects and coordinates agent behavior per request.
ai/openai-agent/src/flows/index.ts - Prismatic hosted tools · Lets agents invoke hosted integrations.
ai/openai-agent/src/agents/tools/prismaticHostedTools.ts - Agent GraphQL client · Provides authenticated Prismatic API access.
ai/openai-agent/src/prismatic/client/graphql.ts - Slack webhook receiver · Acknowledges Slack events before longer processing.
ai/slack-chatbot-agent/src/slack/webhookReceiver.ts - Slack event handler · Filters bot messages, tracks threads, and dispatches agents.
ai/slack-chatbot-agent/src/flows/eventHandler.ts - Next.js chat UI/API · 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 · Receives Prismatic event webhooks and coordinates processing.
api/handle-event-webhooks/src/server.ts - Event processing and storage · Persists/coordinates events and calls Prismatic.
api/handle-event-webhooks/src/handleEvents.ts - Backup/export utility · Exports integration and instance data through Prismatic APIs.
api/backup-integrations-and-instances/src/exportData.ts
Other components
- Prismatic runtime · Executes integrations, components, and deployed flows.
- Prismatic GraphQL/API · Management and integration execution boundary.
- SaaS provider APIs · Includes Asana, Slack, AWS, and other component targets.
- OpenAI Agent SDK/tools
Connections 22
- 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