The gist
Pulls every CRM note attached to a single company record in Attio,
filters out the automated pre-meeting briefs, and returns a clean
{ author, content } array — typically used to auto-populate a fresh
company drive folder (e.g. an "AI Generated Outputs" folder) with the
full CRM history at the moment the folder is scaffolded.
The flow
- Inputs.
ATTIO_TOKEN,COMPANY_RECORD_ID, optionalPARENT_OBJECT(defaults tocompanies),LIMIT(default 49), andMAX_PAGES(default 50). - Paginate
/v2/noteswithparent_object+parent_record_id, stopping when a page returns fewer thanLIMITresults orMAX_PAGESis hit. 200ms delay between pages to stay polite. - Drop pre-meeting notes (anything whose title normalizes to contain "premeeting") so the export is just human-written context.
- Simplify each note to
{ author, content }. Author is parsed from titles like"Note by Jane Doe"; content prefers plaintext and falls back to markdown. - Return a single
payloadfield holding the stringified JSON array — single field so Zapier doesn't try to expand the result into per-note line items.
Swapping CRMs
This is Attio-specific, but the structure is generic. To run against another CRM (Affinity, Salesforce, HubSpot, etc.) swap:
BASE_URL→ that CRM's notes endpoint- The
Authorizationheader for whatever auth scheme the CRM uses - The pagination params (offset/limit vs. cursor) to match the API
- The field mapping inside
simplify()to that CRM's note shape
The pagination loop, pre-meeting filter, and Zapier output shape stay the same.
Why this exists
When a new company gets a drive folder, the most valuable thing you can drop into it is everything the firm has already written about that company. This snippet is the one call that pulls that history out of the CRM in one shot, ready for the next step to write into the folder.