Cinesolve Instagram Automator turns CineSolve reviews in Notion into scheduled Instagram posts. It ingests eligible Notion pages, normalizes review data, renders post images, builds captions, schedules posts through Postiz, and keeps local status in sync.
The workflow is intentionally manual at the Notion boundary: a review is only
processed when its Notion Publication status is set to To be published.
- Ingests review pages from Notion and stores normalized review data locally.
- Renders Instagram-ready review images.
- Generates captions with review details, ratings, dynamic tags, and Instagram character-limit protection.
- Recalculates freshness scores so the scheduler can prioritize timely reviews.
- Schedules, updates, cancels, and verifies posts through the Postiz API.
- Retries failed Postiz posts after publication checks.
- Treats Notion as the source of truth for manual published overrides.
- Supports Telegram notifications and manual workflow commands.
- Exposes a small API with optional API-key protection and rate limiting.
- Python 3.10+
- A Notion internal integration token
- A Notion database shared with that integration
- A Postiz API key and base URL
uvrecommended, though editablepipinstalls also work
Create a Notion integration using the official Notion developer flow, then share the review database with that integration and copy the database ID.
Create or copy your Postiz API key from Postiz settings.
Using uv:
uv syncUsing a virtual environment and pip:
python3 -m venv venv
source venv/bin/activate
pip install -e .Copy the example environment file:
cp .env.example .envSet the required values:
NOTION_API_TOKEN=...
NOTION_DATABASE_ID=...
POSTIZ_API_KEY=...
POSTIZ_BASE_URL=...Optional Telegram notifications and commands:
TELEGRAM_ENABLED=true
TELEGRAM_BOT_TOKEN=...
TELEGRAM_CHAT_ID=...API security is enabled by default for /api/* routes:
CSI_API_KEY=...
CSI_API_REQUIRE_AUTH=true
CSI_API_RATE_LIMIT_ENABLED=true
CSI_API_RATE_LIMIT_MAX_REQUESTS=...
CSI_API_RATE_LIMIT_WINDOW_SECONDS=...
CSI_API_RATE_LIMIT_MAX_SUBJECTS=...For local development only, API-key enforcement can be disabled:
CSI_API_REQUIRE_AUTH=falseFile downloads are restricted to HTTPS and trusted hosts. Adjust these only when the Notion file host list changes:
FILE_DOWNLOAD_ALLOWED_HOSTS=...
FILE_DOWNLOAD_BLOCK_PRIVATE_NETWORKS=trueRun the full workflow:
cinesolve run-allrun-all performs these steps in order:
- Applies Notion published overrides.
- Checks Postiz publication status for due posts.
- Ingests Notion reviews marked
To be published. - Recalculates freshness scores.
- Renders missing or stale images.
- Rebuilds the Postiz schedule.
Ingest eligible Notion reviews:
cinesolve ingest eligibleRecalculate all freshness scores:
cinesolve ingest recalculate-freshnessRender review images:
cinesolve renderSchedule through Postiz:
cinesolve postiz scheduleCheck Postiz status for posts at least 30 minutes past their scheduled time:
cinesolve postiz check-statusInspect the Notion schema:
cinesolve ingest inspect-schemaDump processed Notion pages as JSON Lines:
cinesolve ingest dumpStart the Telegram listener manually:
cinesolve notify listen-telegramWhen RUN_SCHEDULER=true, the app runs as a daemon-style scheduler:
- Starts the Telegram listener when Telegram is enabled.
- Starts the Postiz status checker.
- Schedules the daily
run-allfromCRON_SCHEDULE.
It does not run run-all immediately on startup. Trigger a manual run with
cinesolve run-all or Telegram /run_all.
When the listener is running, the configured chat can use:
/run_allor/run-allto run the full workflow./queueto show queued reviews./scheduledto show scheduled reviews./failedto show failed reviews./next_checkto show the next Postiz status check time./helpto show available commands.
- Create the review in Notion.
- Fill the required review fields.
- Set
Publication statustoTo be published. - Run
cinesolve run-all.
- Edit the review in Notion.
- Set
Publication statusback toTo be published. - Run
cinesolve run-all.
If the review is already scheduled, the scheduler updates the Postiz post when needed.
Check the Notion Priority checkbox before running the workflow. Priority
reviews are placed ahead of non-priority reviews within the scheduler rules.
After Postiz confirms a priority post as PUBLISHED, the app clears the Notion
checkbox so the boost is not reused accidentally.
If a review is scheduled in Postiz but should no longer publish, set its Notion
Publication status to Published. On the next cinesolve run-all, the app
cancels the scheduled Postiz post and marks the review as posted locally.
- Change
FRESH_WINDOW_DAYSin.env. - Run
cinesolve ingest recalculate-freshness. - Run
cinesolve postiz schedule.
Utility scripts live in @assistant_scripts/.
Inspect Postiz posts for a date range:
python @assistant_scripts/check_postiz_posts.pyDelete all non-published Postiz posts:
python @assistant_scripts/delete_non_published_postiz_posts.pyThat delete script is destructive. It removes draft, scheduled, failed, and other non-published posts from Postiz after confirmation prompts.
Install dependencies:
uv syncRun tests:
uv run pytestRun linting:
uv run ruff check .The Notion SDK is wrapped by csi_ingest.notion_api_client.NotionClient so SDK
and Notion API version changes stay isolated from the rest of the application.