Goal
Let OpenSRE post investigation reports to Notion and track incidents in a Notion database. When an investigation completes, the agent should be able to create or update a Notion page with the structured findings — root cause, evidence, timeline, and suggested actions.
Background
Teams already use Notion as a knowledge base for runbooks, postmortems, and incident logs. Today, investigation results live in the terminal or get manually copied into docs. A Notion integration closes that gap: every investigation automatically becomes a searchable, shareable page that the whole team can reference.
Notion's API supports creating pages in databases, appending block content, and querying existing pages — all of which map well to OpenSRE's investigation output.
Scope
New integration: Notion
-
Integration config — Add NotionIntegrationConfig to app/integrations/models.py with api_key and database_id fields. Wire into EffectiveIntegrations.
-
Client — Add app/integrations/clients/notion/client.py wrapping the Notion API:
create_page(database_id, title, properties, content_blocks) — creates a new page in the target database
append_blocks(page_id, blocks) — appends content blocks to an existing page
query_database(database_id, filter) — queries for existing incident pages (dedup, linking)
-
Investigation tool — Add NotionCreateReportTool under app/tools/NotionCreateReportTool/:
- Takes the investigation summary, root cause, evidence list, and severity
- Creates a structured Notion page with sections for each
- Returns the Notion page URL for reference
- Register in
app/tools/investigation_registry/actions.py
-
Wizard integration — Add Notion to the optional integrations in app/cli/wizard/flow.py:
- Prompt for Notion Internal Integration Token
- Prompt for target database ID (or offer to list accessible databases)
- Validate the token against the Notion API
- Persist via
sync_env_values (NOTION_API_KEY, NOTION_DATABASE_ID)
- Store via
upsert_integration
-
Verify support — Add notion to SUPPORTED_VERIFY_SERVICES in app/integrations/verify.py.
Environment variables:
NOTION_API_KEY — Notion internal integration token
NOTION_DATABASE_ID — Default database for investigation reports
Done when
opensre onboard offers Notion as an optional integration and validates the token
opensre verify notion confirms connectivity
- The
NotionCreateReportTool is available to the investigation agent
- After an investigation, the agent can create a Notion page with the full report
- Duplicate investigations update existing pages rather than creating new ones
make lint && make typecheck pass
- Unit tests cover the Notion client and tool
Reference
- Integration models:
app/integrations/models.py
- Integration store:
app/integrations/store.py
- Existing client pattern:
app/integrations/clients/grafana/, app/integrations/clients/datadog/
- Tool base class:
app/tools/base.py
- Tool registry:
app/tools/investigation_registry/actions.py
- Wizard flow:
app/cli/wizard/flow.py
- Env sync:
app/cli/wizard/env_sync.py
- Verify CLI:
app/integrations/verify.py
- Notion API docs: https://developers.notion.com/
Goal
Let OpenSRE post investigation reports to Notion and track incidents in a Notion database. When an investigation completes, the agent should be able to create or update a Notion page with the structured findings — root cause, evidence, timeline, and suggested actions.
Background
Teams already use Notion as a knowledge base for runbooks, postmortems, and incident logs. Today, investigation results live in the terminal or get manually copied into docs. A Notion integration closes that gap: every investigation automatically becomes a searchable, shareable page that the whole team can reference.
Notion's API supports creating pages in databases, appending block content, and querying existing pages — all of which map well to OpenSRE's investigation output.
Scope
New integration: Notion
Integration config — Add
NotionIntegrationConfigtoapp/integrations/models.pywithapi_keyanddatabase_idfields. Wire intoEffectiveIntegrations.Client — Add
app/integrations/clients/notion/client.pywrapping the Notion API:create_page(database_id, title, properties, content_blocks)— creates a new page in the target databaseappend_blocks(page_id, blocks)— appends content blocks to an existing pagequery_database(database_id, filter)— queries for existing incident pages (dedup, linking)Investigation tool — Add
NotionCreateReportToolunderapp/tools/NotionCreateReportTool/:app/tools/investigation_registry/actions.pyWizard integration — Add Notion to the optional integrations in
app/cli/wizard/flow.py:sync_env_values(NOTION_API_KEY,NOTION_DATABASE_ID)upsert_integrationVerify support — Add
notiontoSUPPORTED_VERIFY_SERVICESinapp/integrations/verify.py.Environment variables:
NOTION_API_KEY— Notion internal integration tokenNOTION_DATABASE_ID— Default database for investigation reportsDone when
opensre onboardoffers Notion as an optional integration and validates the tokenopensre verify notionconfirms connectivityNotionCreateReportToolis available to the investigation agentmake lint && make typecheckpassReference
app/integrations/models.pyapp/integrations/store.pyapp/integrations/clients/grafana/,app/integrations/clients/datadog/app/tools/base.pyapp/tools/investigation_registry/actions.pyapp/cli/wizard/flow.pyapp/cli/wizard/env_sync.pyapp/integrations/verify.py