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.
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.
0 6 * * * UTC).0 7 * * * UTC).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.
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.
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.