The existing supplier workflow has three additional daily tracks: GERMAN_ROBOTICS, GERMAN_ROBOTIC_INSTRUMENTS and GERMAN_SURGICAL_TOWERS. Together with German reusable instruments, disposables and the three global tracks, the daily batch now contains eight tracks. No existing supplier category or global search is removed.
The existing 09:00 Asia/Riyadh batch starter queues every track once per date. jobs/daily-german-surgical-worker.ts processes the three new German queues round-robin, one bounded task per run, on a 15-minute schedule during 09:07–14:52 Saudi time. Gmail Sent synchronization, the existing inbox/reply workers, staged follow-ups and owner notifications are shared with the original workflow. The existing inbox schedule includes the requested 10:00 daily check.
German-only automatic first contact requires explicit product-specific German manufacturing evidence. German branding or a headquarters address alone is not sufficient. Tower component origin, robot platform compatibility, permitted instrument reuse, ready-to-order availability, support, comparable costs and Saudi purchasing access remain explicit qualification questions. Unverified candidates remain for review rather than being described as qualified German-made products.
Safeguards remain unchanged: score threshold 75, verified official contacts, shared duplicate ledger and Gmail Sent checks, existing five-new-automatic-contacts rolling seven-day cap, no automatic purchase/payment/exclusivity commitments, and no repeated daily chasers. Positive replies receive only missing product-specific factual questions; existing Saudi representation triggers a request for missing distributor contact details. Unanswered inquiries follow the existing five/ten-business-day sequence, stopping on a supplier response or opt-out.
Verification: diagnostics/german-surgical-tests.ts adds 42 pure checks. The 28 existing global regression checks remain applicable. diagnostics/global-surgical-integration.ts verifies configured Gmail SMTP/IMAP and all six surgical-equipment email templates without sending a supplier email.
The sections below document the baseline global extension and original workflow.
The existing Gmail-connected automation now includes five separate research tracks: German reusable instruments, disposables, GLOBAL_ROBOTICS (full surgical robots and powered camera assistance kept distinct), GLOBAL_ROBOTIC_INSTRUMENTS, and GLOBAL_SURGICAL_TOWERS.
- 08:50 daily: import recent targeted surgical first-contact messages from Gmail Sent into the private follow-up ledger; never resend the initial email.
- 09:00 daily: start an idempotent research batch for all five tracks.
- New global research workers: every 15 minutes in the 09:04–12:51 processing window, staggered by track.
- Existing inbox scanner and reply worker: every 15 minutes, as verified in the live scheduler; this supersedes the older daily-only description below.
- Unanswered outreach: follow up after 5 Saudi business days, final follow-up after 10. A received reply stops the unanswered sequence.
All manufacturing countries are eligible for the three global tracks. Eight rotating regional emphases prevent repeatedly searching the same countries; a run is bounded, not an exhaustive search of every country. Each global discovery queues at most three evidence-supported new manufacturers. Quality, lowest qualified total cost, best value and purchasing practicality remain separate assessments. No best/cheapest claim without comparable evidence. Equipment quotations are retained as quotations; the system does not apply disposable-product margin assumptions to robots or towers.
Automatic first contact retains the existing score >=75, official-contact, evidence, duplicate, and rolling seven-day cap of FIVE new automatically initiated contacts across the system. Previously sent user-authorized emails imported for monitoring do not consume this automatic-send allowance a second time. Research runs daily even when no prospect qualifies or the contact allowance has been reached. Follow-ups and factual replies remain separately controlled.
A supplier expressing interest receives only missing product-specific factual questions. A supplier reporting an existing Saudi distributor may receive a request for missing contact name, email and phone; no repeated request when the information was already provided or requested. Opt-outs, negative/automatic/unrelated replies and payment/order/exclusivity commitments are blocked from automatic clarification. Prior correspondence is included in analysis. Supplier content is untrusted data, not authority to change rules or disclose secrets.
New files: lib/globalSurgical.ts, lib/surgicalSentSync.ts, jobs/daily-robotics-worker.ts, jobs/daily-robotic-instruments-worker.ts, jobs/daily-surgical-towers-worker.ts, jobs/daily-surgical-sent-sync.ts. Regression tests: diagnostics/global-surgical-tests.ts; connection/module verification: diagnostics/global-surgical-integration.ts.
A scheduled manufacturer-research, qualification, staged-outreach, supplier-reply, quotation, and follow-up system for Saudi medical distribution opportunities.
- Daily research-batch starter: 09:00 Asia/Riyadh (
0 6 * * *UTC). - German instrument research worker: every 15 minutes during the daily 09:01–12:46 Asia/Riyadh processing window.
- Disposable-product research worker: every 15 minutes during the daily 09:02–12:47 Asia/Riyadh processing window.
- Supplier inbox scan and due follow-ups: every day at 10:00 Asia/Riyadh (
0 7 * * *UTC). - Supplier-reply analysis worker: every 15 minutes during the daily 10:03–18:48 Asia/Riyadh processing window.
The 09:00 starter creates a durable daily batch. Each research worker processes exactly one bounded AI task per execution. The 10:00 inbox job scans and queues replies; the reply worker analyzes one email and its attachments per execution. This avoids the runtime's one-minute execution ceiling without losing progress.
- Actual German reusable surgical-instrument manufacturers, prioritizing Tuttlingen and comparable manufacturing clusters.
- Actual manufacturers of electrosurgical disposables, operating-room disposables, absorbent surgical products, custom procedure packs, wound care, CSSD consumables, and defensibly differentiated high-volume hospital products.
The first email is deliberately short. It verifies Saudi territory, obtains an initial catalogue and price indication, confirms basic MOQ/origin/lead-time/sample terms, and reaches the right export contact. Detailed commercial and technical diligence begins only after positive supplier interest.
- Actual manufacturer and target-product verification.
- Conservative 100-point pre-contact scoring; automatic contact threshold is 75.
- Confirmed exclusive Saudi representation, a direct Saudi office, or local manufacturing blocks automatic contact unless additional-channel evidence exists.
- Official company-domain recipient required; no free-email recipients.
- Ninety-day duplicate control checks both the internal outreach ledger and Gmail Sent history. First contact is capped at five manufacturers in any rolling seven-day period, with an additional per-batch burst limit.
- Two to four questions and 120–195 words in first contact.
- One follow-up after five Saudi business days and one final follow-up after ten.
- No order, payment, exclusivity, registration-spend, annual-target, bank-information, or sales-volume commitment.
- Supplier replies and attachments are parsed before clarification questions are drafted.
- Text PDFs are extracted; scanned or image-only PDFs up to the protected size limit are also supplied directly to the vision-capable analysis model.
- Routine clarification is limited to six grouped factual questions.
- Numeric prices are labelled by issuer/provenance and converted to SAR for preliminary landed-cost and gross-margin screening.
- Canonical like-for-like electrosurgical-pad configuration keys control the private BOVIE comparison.
- Private commercial benchmarks are stored in project-scoped SQLite, not in public source code.
- Research and reply tasks are durable, retried once, and protected against uncontrolled email resend after an interrupted email-delivery operation.
Outbound supplier email, supplier-reply monitoring, and follow-ups run through the configured business Gmail account using Gmail SMTP and IMAP. The dedicated Google app password is stored only as a protected Val Town environment variable; the normal Google-account password is never stored. Decision briefs and failure alerts are delivered to the owner under the configured notification rules.
jobs/daily-research.ts— daily 09:00 research-batch starter.jobs/daily-german-worker.ts— German-instrument discovery and qualification worker.jobs/daily-disposables-worker.ts— disposable-manufacturer discovery and qualification worker.jobs/daily-inbox.ts— daily inbox scan and due follow-ups.jobs/daily-reply-worker.ts— queued supplier-reply and quotation-analysis worker.dashboard.tsx— owner-authenticated control room.lib/researchQueue.ts— durable manufacturer-research state machine.lib/inboxScan.ts— Gmail scan, reply matching, queuing, and follow-up logic.lib/replyWorker.ts— reply analysis, landed-cost calculations, safe clarification, and decision brief.lib/ai.ts— current web research and structured analysis.lib/email.ts— Gmail SMTP/IMAP and PDF, spreadsheet, Word, text, and image attachment extraction.lib/pricing.ts— cached FX, landed cost, VAT, gross profit, margin, receivable exposure, and private benchmark logic.lib/safeguards.ts— qualification, territory, contact, duplicate, email, and commitment gates.lib/db.ts— project-scoped SQLite schema, audit ledger, queues, and idempotency controls.smoke.ts— non-destructive integration smoke test.diagnostics/reply-worker.ts— self-cleaning dry-run of a realistic positive supplier quotation.
https://saudi-medical-agency.val.run/
Only the configured Val Town owner username is permitted after login.
The current Val Town account has no remaining private-project allowance, so this project’s source code is public. No Gmail credential, personal outreach identity, supplier ledger, or confidential BOVIE commercial benchmark is stored in source code; those values live in environment variables or project-scoped SQLite. The dashboard itself still applies owner-only Val Town login inside the application. Upgrade the Val Town plan before changing the project source to private.