# Brindlecart lead intake: the spec Made by 8gentc for the automation lane test; use it only for the test. Kit version 2026-10-28. Brindlecart is a fictional company that sells warehouse-picking software. Everything in this kit is invented: the company, its staff, its customers and their companies. Every domain ends in `.example`, a name reserved for examples. This page has the rules every applicant shares. Your **spec card** (`spec-card.md`, made by `generate.mjs` from your Whop username, your attempt number and your start code) has the values that are yours: where each field sits in the form's JSON, your house routing rule, the thresholds, the owners and their channels, the countries in each region, how your CRM is searched, the free-mail domains, and your sandbox key, token and secret. ## Starting When you're ready, message 8gentc on Whop to ask for your start code, with the day and time you want to start (and your time zone), at least one working day ahead. We send your start code then, and your 48 hours run from the time on our message. That **start message** gives your attempt number, your 8-character **start code** and the time to hand in by. Make your pack with `node generate.mjs --user --attempt --code `. Before the start message you can learn the kit on a practice-only pack (leave out `--code`), but your test pack, its spec card and our hidden set all come from the start code. The test is about 4 hours of focused work. ## The job Brindlecart's website has a "Talk to us" form. The form provider sends every submission to a webhook as JSON, one submission per call. Today someone copies each one into the CRM by hand; leads go cold, duplicates pile up and support questions get lost among sales leads. Build one workflow, in **n8n** or **Make**, that takes each submission from the webhook and does the steps below. The CRM, the enrichment API, the helpdesk, the team chat and the intake log are fake services in the **sandbox** (`sandbox.mjs`) that runs on your computer. They behave like real APIs: they need a key or token, check what you send and sometimes fail. ## The steps, in order 1. **Check the secret.** A request without the right `X-Intake-Secret` header gets HTTP 401 or 403 and nothing else happens: no calls to any service, no log row. 2. **Answer the form.** Every accepted request gets HTTP 200 with the JSON body `{"received": true, "submission_id": ""}` within 10 seconds. You may answer at once or after processing. 3. **Clean the input.** Trim spaces from every text value. Lower-case the email. Upper-case the country code (blank stays blank). Turn the interest label into the CRM value with the table on your card. Marketing consent is `true` only when the form sent the JSON value `true`, or the text `true` or `yes` in any case; anything else, or nothing, is `false`. 4. **Stop what isn't a lead**, checking in this order, and write a log row for each: - the spam-trap field is not empty (after trimming): status `spam`, reason `honeypot`; - the first name is empty (after trimming): status `rejected`, reason `missing_name`; - the email doesn't match `^[^\s@]+@[^\s@]+\.[^\s@]+$` (after cleaning): status `rejected`, reason `invalid_email`. Nothing else happens for these: no CRM, no helpdesk, no enrichment, no message. 5. **Support requests go to the helpdesk.** If the interest is `support`, create a ticket and stop: `POST /helpdesk/tickets` with `submission_id`, `requester_email` (the cleaned email), `requester_name` (first and last name with one space between, or the first name alone when the last name is empty), `subject` (exactly `Website form: support request`) and `body` (the message). Log status `ticket`. No CRM, no enrichment, no message. 6. **Look the person up in the CRM** by the cleaned email, with the lookup on your card (section 3). Each CRM has one of three; the others answer 404 on your sandbox: - `GET /crm/contacts?email=`: 200 with `{"results": [...]}`, an empty list when there's nobody; - `POST /crm/contacts/search` with exactly `{"email": ""}`: 200 with `{"total": , "contacts": [...]}`; - `GET /crm/contacts/by-email/`: 200 with the contact, or **404** `{"error": "not_found"}` when there's nobody (a normal answer here, not a failure). The CRM matches emails exactly, so clean them first. 7. **Someone already in the CRM is updated, not added.** `PATCH /crm/contacts/` with exactly `interest`, `marketing_opt_in` and `last_submission_id`. Keep their owner. Post a message to their owner's channel (step 11). Don't call enrichment. Log status `updated`. 8. **Enrich new contacts.** Take the domain of the cleaned email. - A free-mail domain (on your card): don't call enrichment. Enrichment `skipped_free_mail`. - Otherwise `GET /enrich/company?domain=` with your key in the `X-Api-Key` header. - 200: use `employees` and `industry`. Enrichment `ok`. - 404: no data for that company. Enrichment `not_found`. - 429 or 503: the API is busy. Wait at least 1 second and try again. Make **at most 3 tries** in all for one submission. Busy answers come at most twice in a row, so 3 tries get through unless the API is down. - Still 429 or 503 after the third try: enrichment `unavailable`. Carry on without the company data, and post one alert (step 12). 9. **Pick the owner**, checking in this order. First your card's **house rule** (one of: partnership enquiries go to a partnerships owner; leads from one named country go to that country's owner; demo requests from companies under the mid-market threshold, or of unknown size, go to a self-serve owner): if it applies, that owner, whatever else is true. Otherwise, with a known employee count at or above your enterprise threshold: the enterprise owner. At or above the mid-market threshold: the mid-market owner. Otherwise, and whenever the employee count is unknown: the owner of the submitter's country (your region table), or `Unassigned` when the country isn't in it or is blank. 10. **Create the contact.** `POST /crm/contacts` with exactly these fields: | Field | Value | |---|---| | `email` | the cleaned email | | `first_name`, `last_name` | trimmed (`last_name` may be `""`) | | `company` | as typed in the form, trimmed (may be `""`) | | `country` | the cleaned country code (may be `""`) | | `interest` | the CRM value from your card's table | | `marketing_opt_in` | `true` or `false` (a JSON boolean, not text) | | `owner` | the owner's name from your card, or `Unassigned` | | `employees` | the number from enrichment, or `null` | | `industry` | the text from enrichment, or `null` | | `source` | `web-form` | | `submission_id` | the submission id | If the CRM answers with anything but 201 (it fails for some emails on purpose), don't post a lead message: post one alert (step 12) and log status `error`, reason `crm_error`. Then carry on with the next submission as normal. 11. **Tell the owner.** `POST /chat/messages` with `{"channel": "", "text": "..."}`. The text must include the CRM id and the owner's name. It must **not** include the person's email address or their message. Name, company and CRM id are enough for the owner to open the record. 12. **Alert when something failed.** For enrichment `unavailable` and for a CRM failure, post exactly **one** message to `#automation-alerts` naming the submission id and what failed (`enrichment_unavailable` or `crm_error`). No email address. Don't alert for anything else in this list. 13. **Log every submission, once.** `POST /log/rows` with exactly: | Field | Value | |---|---| | `submission_id` | the submission id | | `status` | `created`, `updated`, `ticket`, `rejected`, `spam` or `error` | | `reason` | `""` for created, updated and ticket; otherwise `missing_name`, `invalid_email`, `honeypot`, `crm_error`, or `unexpected` for any other failure you catch | | `enrichment` | `ok`, `not_found`, `unavailable`, `skipped_free_mail`, or `not_needed` (spam, rejected, ticket and updated) | | `owner` | the owner of the contact you created or updated; otherwise `null` | | `crm_id` | the id of the contact you created or updated; otherwise `null` | | `processed_at` | the date and time, ISO 8601, e.g. `2026-11-02T09:15:00Z` | ## How it must be built - **Platform:** n8n (self-hosted Community Edition, or a cloud trial) or Make. We can only re-run n8n workflows and Make blueprints. - **Started by a webhook.** - **The sandbox address in one setting per workflow**, such as a step named Config at the start, so that whoever installs the workflow changes one value. Every service call builds its address from that setting. A separate n8n error workflow can't read the main workflow's steps, so it has its own Config step: the address then appears once in each workflow. - **The enrichment key and the CRM token in your platform's credentials** (n8n credentials, or a Make keychain), never typed into a step. The intake secret may live in an n8n credential or in your one settings step; either way, say in your README where it is, because the grader sets our own secret there. - **Routing in the platform's own routing steps** (n8n If, Switch or Filter; Make routers and filters), so Brindlecart's ops team can read and change the rules. Code steps are fine for small clean-up, up to 20 lines each, and never make HTTP calls. - **No credentials, keys or test data in the export.** Unpin any pinned data before you export. - **Built-in steps only, and nothing that touches the server.** No steps that run commands or read or write files (n8n Execute Command, SSH, FTP, Read/Write Files from Disk and the like), and no community nodes; in Make, only Make's own built-in apps (such as Webhooks, HTTP, Tools, Flow Control, JSON and Text parser), never an app that needs an outside account. A person reads every export before it runs. A workflow we can't run safely can't earn the points that need a run. - **An error path** for failures you didn't plan for (n8n: an error workflow or error outputs; Make: error handlers), ending in at least an alert. - **Readable:** steps named for what they do, and notes inside the workflow for each part. ## What you hand in 1. Your workflow export: the n8n workflow `.json` (plus your error workflow's `.json` if it is separate) or the Make blueprint `.json`. 2. `run-log.jsonl`: the run log the sandbox wrote while `replay.mjs` sent your practice set through your workflow. 3. `README.md` for Brindlecart's ops team: how to set it up (import, credentials by name, the one setting), what each branch does, what each alert means and what to do about it, how to test it with the replay tool, and anything it doesn't handle. Put the three in one folder or zip that opens without signing in, and hand it in through the Submit form within 48 hours of your start message. Up to 24 hours late is still graded, but scores 0 on the on-time points. Later than that isn't graded and counts as your attempt, so the 14-day retake wait starts. In the Submit form, add the username, attempt and start code you made your pack with, your platform, its version and plan, every other tool you used (AI assistants included) and what each did, and roughly how long it took. ## How it is graded We read your export first, then import it into a fresh n8n or Make account that has no real connections (for n8n, on a private network that reaches only our sandbox), set the one address in each workflow and our own key, token and secret where your README says they live, and run `replay.mjs` with a hidden set of 30 new submissions made from your seed and a private salt. They are the same kinds of cases as your practice set, with different people, companies, domains and failures. `check.mjs` then drafts the objective points, an AI assistant may draft the points a person judges, and the founder reads your README, notes and workflow and confirms every score. The rubric is on the test page.