feat(typescript-recipes): add parallel-procurement-n8n recipe#37
Draft
s-jag wants to merge 2 commits into
Draft
Conversation
Continuous vendor risk monitoring built on the Parallel Task and Monitor APIs, orchestrated by n8n, with Slack-routed alerts and a cited audit log. - One combined n8n workflow (50 nodes) covering vendor sync, daily Deep Research via Task Groups, V1 event-stream monitors, deterministic risk scoring, Slack severity routing, and an /vendor-research slash command. - 46 Vitest suites covering services, models, workflow JSON structure, full pipeline integration, vendor lifecycle, error scenarios, and scale simulation (200 / 3000 vendors). - Optional Next.js + Supabase BYOK dashboard reimplementing the same business logic for users who would rather not run n8n. - Registered in README.md (Scheduled Research & Webhooks) and website/cookbook.json per CONTRIBUTING.md. Co-authored from the n8n-procurement folder of shapleyai/parallel-integrations-and-demos.
The auth/key route returned "Parallel rejected this key" before the email lookup, so a valid Parallel key with a wrong email produced a different error than an invalid key — a credential-stuffing recon oracle. Defer reporting the Parallel-test failure until after the account lookup so both branches return the same generic "Email or Parallel API key is incorrect" 401. Add tests covering both bad-key/known-email and bad-key/unknown-email paths.
Collaborator
|
Replacement implementation is now in #51. It preserves Sahith’s attribution while applying the newer scripts-first scope: one local TypeScript recipe, current V1 Task + snapshot Monitor APIs, deterministic policy, tested cleanup, and article-ready source/diagram links. |
zhengchaol
pushed a commit
that referenced
this pull request
Jul 14, 2026
## What this adds This PR adds a local TypeScript recipe for researching vendor risk and keeping the result current with Parallel. It has three commands: - `bootstrap` researches each vendor, applies a deterministic risk policy, and starts a snapshot Monitor. - `check-updates` reads new Monitor events and runs focused follow-up research when a change crosses the review threshold. - `cleanup` cancels the Monitors recorded in local state. The README explains what each command does, when it consumes credits, what a successful result looks like, and how to recover after an interrupted command. The implementation uses the current TypeScript SDK and V1 Monitor API. ## Why it is local The earlier version in #37 combined n8n workflows, a TypeScript layer, and a hosted Next.js/Supabase app. That gave readers several implementations of the same workflow and a lot of infrastructure to set up. This version keeps one implementation and one local state file. A reader needs Node.js and a Parallel API key; there is no database, frontend, webhook, or deployment step. Because there is no hosted demo, the Cookbook now supports `websiteUrl: null` and hides the Demo button for verified local recipes. This PR supersedes #37 and keeps Sahith's attribution in the Cookbook registry. ## Try it The normal checks do not call the Parallel API: ```bash cd typescript-recipes/parallel-vendor-intelligence npm ci npm run validate npm audit --audit-level=high ``` To use the recipe, copy `.env.example` to `.env`, add `PARALLEL_API_KEY`, and run: ```bash npm run --silent bootstrap | jq # Leave the Monitor active. Run this later to process new events: npm run --silent check-updates | jq # Run this when you are finished monitoring: npm run --silent cleanup | jq ``` The opt-in live test consumes credits. It researches Cloudflare, creates a snapshot Monitor, checks for updates, cancels every Monitor it created, and confirms the remote status: ```bash npm run test:live ``` ## Verified - A fresh Node.js 20 install passes the TypeScript check and all 106 deterministic tests. - The dependency audit reports no vulnerabilities. - Package, schema, secret, and repository pre-commit checks pass. - A production run completed a real `core` Task and `lite` Monitor lifecycle, including confirmed cancellation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new recipe under
typescript-recipes/parallel-procurement-n8n/— continuous vendor risk monitoring built on the Parallel Task and Monitor APIs, orchestrated by n8n, with Slack-routed alerts and a cited audit log. Slots into the Scheduled Research & Webhooks category next toparallel-daily-insights.What's in the recipe:
/vendor-researchslash command.output.basislift-through — every assessment and Slack alert carries the top citation per dimension, and the audit log writestop_citation_url/top_citation_title/confidenceper row.DEPLOY.md.Registered in both indexes per
CONTRIBUTING.md:README.mdunder Scheduled Research & Webhooks.website/cookbook.json(slugparallel-procurement-n8n).Why draft
Submitting as draft because a few items from the cookbook quality bar are still TODO:
system-architecture.excalidrawand friends); will export a PNG intodocs/for the README.creatorsfield incookbook.json— currently["sahith-3694"]; tell me if it should be a different handle.PR Checklist (
CONTRIBUTING.md)npm ci && npm test→ 629 passed).env/.dev.varscommitted —pre-commit runpasses (detect-private-key,gitleaks,forbid-env-files)\$vars.PARALLEL_API_KEYand{{ \$env.SLACK_WEBHOOK_URL }}placeholders; dashboard reads everything from envdashboard/vercel.json)package-lock.jsonat root and indashboard/)README.mdandwebsite/cookbook.jsonTest plan
README.mdtable row andcookbook.jsonentry againstcookbook.schema.jsonnpm ci && npm testinsidetypescript-recipes/parallel-procurement-n8n/