Give new BambooHR hires a Brex card with the right limit

By General Input

When someone new lands in BambooHR, we add them to Brex, issue a virtual card in their name, apply your department spending cap, and tell People Ops in Slack.

Integrations

  • BambooHR
  • Brex
  • Slack

Type

Deterministic Code

Categories

  • HR & People
  • Finance

Watch BambooHR for new employee records and provision the new hire's Brex spend access automatically. Use a BambooHR poll trigger on the new employee event so the workflow runs shortly after an employee record is created. Build this as a deterministic code workflow: every step is a known operation over structured fields, with no open-ended reasoning.

When the trigger fires, read the new hire's first and last name, work email, department, and start date from the BambooHR employee record using Get Employee. If the work email is missing, stop and post a Slack message saying the hire was skipped and why, rather than creating a card with no usable owner.

Next, make sure the person exists in Brex. Call Brex List users filtered by that work email. If a user already exists, reuse that user id. If not, call Brex Invite user with their name and work email. Order matters here: the Brex user id has to exist before a card can be assigned to an owner, so this step must complete before card creation.

Then issue the card. Call Brex Create card to create a virtual card in the new hire's name, owned by the Brex user id from the previous step. POST /v2/cards requires an Idempotency-Key header holding a V4 formatted UUID. Derive that key deterministically from the BambooHR employee id, for example by hashing the employee id into a UUID-shaped string, so a re-run for the same employee always sends the identical key and Brex returns the original card instead of issuing a duplicate. Never generate a fresh random key on each run, since that is exactly what causes duplicate cards.

Attach the spending cap with Brex Create spend limit, tied to the new card and its owner. Resolve the monthly amount from an editable department lookup table defined at the top of the workflow, so a non-technical admin can change the numbers in one place. Seed it with Sales at 2000 USD, Engineering at 500 USD, and a default of 250 USD for any department not listed, including a missing or blank department. Brex takes monetary amounts as integer minor units plus a currency code, so 2000 USD is sent as an amount of 200000 with currency USD.

Finish with Slack Send a Message to a People Ops channel confirming the provisioning: the employee's full name, their department, their start date, and the monthly limit that was applied. Keep the message readable so IT and finance can both act on it without opening Brex. If any Brex call fails, post that failure to the same channel naming the employee and the step that failed, so a half-provisioned hire is never silent.

Brex allows 5,000 card creations per 24 hours and returns HTTP 429 when rate limited, so retry with exponential backoff and jitter rather than failing the run outright.

Related prompts

Explore more prompts
Call overdue Xero customers with an AI collections agentWin back LiveChat visitors whose chats went unansweredChat quality review board for LiveChat support leadsWin back no-show and cancelled appointments every morningLive Loop returns analytics with product-level drill-downNewsletter pre-flight and approval board for Mailjet sendsTurn a prospect spreadsheet into personalized sequence enrollmentsMailjet email delivery lookup console for support teamsCatch feature flags that never got switched on in productionKajabi customer support console for member access fixes