Import Data from SaaS Services
Create Context Graph can pull data from SaaS services and map it into your Neo4j knowledge graph. This guide covers how to configure connectors during project scaffolding and how to re-import data afterward.
Available Connectors
| Service | What It Imports | Auth Method |
|---|---|---|
| GitHub | Repositories, issues, pull requests, commits, users, code reviews | Personal access token (PAT) |
| Notion | Pages, databases, blocks, users, comments | Internal integration token |
| Jira | Projects, issues, sprints, users, comments, worklogs | API token + Atlassian email |
| Slack | Channels, messages, threads, users, reactions | Bot token (OAuth) |
| Gmail | Emails, threads, contacts, labels, attachments (metadata) | Google OAuth 2.0 / service account |
| Google Calendar | Events, attendees, calendars, recurring series | Google OAuth 2.0 / service account |
| Salesforce | Accounts, contacts, opportunities, leads, cases, activities | OAuth 2.0 connected app |
Selecting Connectors in the Interactive Wizard
When you run create-context-graph my-app, the wizard includes a step to connect SaaS services:
- Select "Connect to SaaS services" when prompted for your data source.
- Pick one or more connectors from the checklist.
- Enter the required credentials for each selected connector (tokens, keys, etc.).
- The scaffolded project will include connector configuration in
.envand an import pipeline inbackend/scripts/.
Non-Interactive CLI Usage
Pass --connector flags to skip the wizard:
create-context-graph my-app \
--domain software-development \
--framework pydanticai \
--connector github \
--connector slack
You can combine --connector with any domain and framework flags. Each connector will prompt for its credentials unless they are already set as environment variables.
Gmail and Google Calendar Setup
Gmail and Google Calendar connectors use the Google Workspace CLI (gws) for OAuth flows. When you select either connector, the wizard checks whether gws is installed:
- If found, it uses
gwsto handle the OAuth consent flow and token refresh. - If not found, the wizard offers to install it automatically (
pip install gws). - You can skip the install and provide a service account JSON key file instead.
Both connectors share the same Google Cloud project credentials, so configuring one makes the other available with no extra setup.
Re-Importing Data in a Generated Project
After scaffolding, the generated project includes Makefile targets for data import:
# Import data from all configured connectors
make import
# Import data and seed the graph with demo scenarios
make import-and-seed
These targets read credentials from the .env file in the project root.
Connector Credential Setup
GitHub
- Go to Settings > Developer settings > Personal access tokens > Tokens (classic).
- Generate a token with
repo,read:org, andread:userscopes. - Set
GITHUB_TOKENin.env.
Notion
- Go to notion.so/my-integrations and create an internal integration.
- Copy the Internal Integration Secret.
- Share the target pages/databases with your integration.
- Set
NOTION_TOKENin.env.
Jira
- Go to id.atlassian.com/manage-profile/security/api-tokens and create an API token.
- Set
JIRA_EMAIL,JIRA_API_TOKEN, andJIRA_BASE_URL(e.g.,https://yourorg.atlassian.net) in.env.
Slack
- Create a Slack app at api.slack.com/apps.
- Add bot token scopes:
channels:history,channels:read,users:read,reactions:read. - Install the app to your workspace and copy the Bot User OAuth Token.
- Set
SLACK_BOT_TOKENin.env.
Gmail / Google Calendar
- Create a project in Google Cloud Console.
- Enable the Gmail API and/or Google Calendar API.
- Create OAuth 2.0 credentials (Desktop app type) and download the JSON file.
- Set
GOOGLE_CREDENTIALS_FILEin.envpointing to the downloaded JSON.
Salesforce
- In Salesforce Setup, go to App Manager and create a new Connected App.
- Enable OAuth and select scopes:
api,refresh_token,offline_access. - Set
SALESFORCE_CLIENT_ID,SALESFORCE_CLIENT_SECRET,SALESFORCE_USERNAME,SALESFORCE_PASSWORD, andSALESFORCE_SECURITY_TOKENin.env.