# Sync new Primeforge mailboxes to Smartlead every hour

> Every hour, add newly provisioned Primeforge mailboxes to Smartlead as sending accounts so your outreach platform stays in lockstep with your infrastructure.

- Workflow type: code
- Services: Primeforge, Smartlead, Google Sheets
- Categories: Sales, Operations
- Published: 2026-07-08

## What it does

- Checks your Primeforge workspace every hour for mailboxes that have not been added to Smartlead yet.
- Adds each new mailbox to Smartlead as a sending account using the SMTP and IMAP details from Primeforge.
- Keeps a running log in a Google Sheet of every mailbox that has already been synced, so nothing gets added twice.
- Skips any Primeforge mailbox that is scheduled for deletion so you never send from a mailbox that is on its way out.

## What you'll need

- A Primeforge account with mailboxes provisioned in a workspace.
- A Smartlead account you can add sending accounts to.
- A Google account and a Google Sheet with a tab that will hold the sync log (two columns: mailbox ID and synced-at timestamp).

## Prompt

Build a code workflow that runs on a cron schedule every hour and syncs newly provisioned Primeforge mailboxes into Smartlead as sending accounts, using a Google Sheet as the sync ledger.

Trigger: cron, hourly.

Steps:

1. Call Primeforge List Workspaces to resolve the target workspace ID. Support either syncing all workspaces the API key can see or a single configured workspace ID as an input parameter.

2. For each workspace, call Primeforge List Workspace Mailboxes to fetch the current mailbox records, including their SMTP and IMAP host, port, username, password, and their deletion status.

3. Read the sync ledger in Google Sheets using Get Values. The ledger is a two-column sheet where column A is the Primeforge mailbox ID and column B is the ISO timestamp it was synced. Both the spreadsheet ID and the tab/range (default 'Log!A:B') should be workflow inputs.

4. Diff the two lists: build the set of already-synced mailbox IDs from column A of the ledger, then produce the list of Primeforge mailboxes whose ID is NOT in that set. Also drop any mailbox whose status indicates it is scheduled for deletion, so we never sync a mailbox that is on its way out.

5. For each remaining new mailbox, call Smartlead Create Email Account with the mailbox's email address, display name, and the SMTP/IMAP host, port, username, and password from the Primeforge record. Use SSL/TLS defaults appropriate to the provider (Google Workspace vs Microsoft 365) based on the mailbox platform field.

6. On a successful create response from Smartlead, call Google Sheets Append Values against the same log range to append a new row with the mailbox ID and the current ISO timestamp. This is what makes the workflow idempotent across runs.

7. If Smartlead returns an error for a specific mailbox (for example, the email already exists in Smartlead), log it, do NOT append to the ledger, and continue with the next mailbox. One failure should not stop the batch.

Inputs the workflow should expose: Primeforge workspace ID (optional, default: all accessible workspaces), Google Sheets spreadsheet ID (required), sheet/range for the ledger (default 'Log!A:B').

Output: a summary object per run with counts of mailboxes discovered, skipped (already synced), skipped (scheduled for deletion), synced successfully, and failed, plus the list of newly synced mailbox IDs.

Notes: Primeforge is not a supported poll provider, so cron plus a diff against the Google Sheets ledger is the intended pattern. Primeforge list endpoints return a flat JSON array and every resource is nested under a workspace. Smartlead's Create Email Account expects SMTP and IMAP host/port/username/password fields.

## How to customize

- Change how often it runs. Hourly is the default, but you can move it to every 15 minutes for fast-turnaround agencies or once a day if you only provision in batches.
- Filter which mailboxes get synced. Restrict by workspace, domain, or setup so different clients land in different Smartlead accounts.
- Point the log at a different sheet or tab. Any two-column sheet where the first column is the mailbox ID will work as the ledger.

## FAQ

### Why not just add mailboxes to Smartlead manually?

You can, but agencies routinely provision dozens of mailboxes at a time and forget to attach them to the sending platform. This closes that gap automatically so every mailbox you pay for actually sends.

### What happens if a mailbox is already in Smartlead?

The workflow keeps a log in Google Sheets of every mailbox it has already synced. On each run it diffs the current Primeforge mailboxes against the log, so nothing gets added twice.

### Will it sync mailboxes that are scheduled for deletion?

No. Any Primeforge mailbox marked for deletion is skipped, so you never end up sending from a mailbox that is on its way out.

### Can I use this with more than one Smartlead account?

Yes. Duplicate the workflow, point each copy at a different Primeforge workspace, and connect the matching Smartlead account. Each copy keeps its own row in its own log sheet.

### Do I need to prepare the Google Sheet in advance?

Yes, but it is simple. Create a sheet with two columns, a mailbox ID column and a synced-at timestamp column. The workflow appends a new row every time it syncs a mailbox.

Use this prompt in General Input: https://www.generalinput.com/prompts/sync-new-primeforge-mailboxes-to-smartlead-every-hour