Skip to main content

Start trumpet workflows from Salesforce

Set up a Salesforce Flow that starts a trumpet workflow when an opportunity changes stage, is created, or a field changes.

Written by Bel Gernale

⚡ Workflows and the Salesforce trigger are in beta, available to selected customers on request. Ask your Customer Success Manager or trumpet support to switch it on for your workspace. Steps and screens may still change.

Start a trumpet workflow automatically when something happens to a deal in Salesforce — an opportunity moves to a new stage, a record is created, or a field you choose changes. For example, when an opportunity reaches a stage you pick, trumpet can create a pod for that deal, already linked to the Salesforce record. If you add a Find pod step (see Recommended workflow actions below), later events for the same deal reuse that pod instead of creating a duplicate — trumpet doesn’t stop duplicate pods on its own.

Salesforce sends each event to trumpet using a Salesforce Flow — Salesforce's own automation tool — which your Salesforce admin builds and controls. No code is needed. In trumpet you choose the Salesforce trigger when you build the workflow; the Flow then calls it from your Salesforce org.


How it works

  • Setup is done once: 2 steps in trumpet (by a trumpet admin) and 4 steps in Salesforce (by a Salesforce admin).

  • After setup, every time your chosen event happens, the Flow sends the deal to trumpet and your workflow runs a few seconds later.

What you need to get started

  • A trumpet admin to create an API key and build the workflow.

  • A Salesforce admin who can create Flows, Named Credentials and Permission Sets.

  • Salesforce Enterprise, Unlimited, Performance or Developer edition.

  • If the workflow creates pods linked to Salesforce opportunities: the Salesforce integration connected in trumpet (Settings → Integrations). The Flow must run in that same Salesforce org — if it runs in a different org, trumpet can't find the opportunity and the run fails. See Setting up the Salesforce integration.


Part 1 — In trumpet

Step 1: Create an API key

  1. Go to Settings → API Keys. Give the page a moment to load — the Create key button appears once your admin role has loaded.

  2. Click Create key and name it, for example Salesforce Flow.

  3. Tick any scope. Workflows don't check scopes, so any one works — Create Pod is a sensible choice.

  4. Click Create key and copy the key (it starts with trpt_). It's only shown once. You'll hand it to your Salesforce admin in Part 2.

Treat the key like a password — it can start any active API-triggered workflow in your workspace. To rotate it, create a new key, update Salesforce (Step 3), then revoke the old one.

Step 2: Build the workflow

  1. Go to Workflows and click Create workflow.

  2. In Select a template, click Start from scratch. Name the workflow, for example

    Salesforce - Opportunity stage changed, and click Create.

  3. Click Select a trigger and choose Salesforce (marked Beta).

  4. The Salesforce panel shows a One-time setup in Salesforce note, then the Workflow link with a Copy button. Copy it; your Salesforce admin needs it in Part 2. The panel's Create an API key link opens Step 1 if you haven't made a key yet.

  5. Under What Salesforce sends, the panel lists the fields every run receives. They're set for you and can't be added, renamed or removed. Click Show example to see a sample of what Salesforce sends. Amount and Account name are marked Optional: they can be blank. The others are required.

Field

Type

From Salesforce

opportunity_id

Text

Opportunity ID

opportunity_name

Text

Opportunity Name

stage

Text

Stage

amount (optional)

Number

Amount

account_name (optional)

Text

Account Name

crm_type

Text

Always salesforce

crm_object

Text

Always Opportunity

6. Click the + under the trigger and add the steps the workflow should run, for example Create Pod from template. trumpet doesn't stop duplicate pods on its own: every Salesforce event runs every step again. To create one pod per opportunity and reuse it on later events, follow Recommended workflow actions below.

7. Choose who the workflow runs for (Enrollment, top left). Pick one user, for example For me. Each enrolled user gets their own run for every Salesforce event. If you use Find pod (see Recommended workflow actions), later events reuse the deal's pod whoever they run for. On a deal's first event, though, the runs for several users can overlap and each create a pod, so keep it to one user. Click Save changes, then switch on Enable. Disabled workflows don't respond to Salesforce.

Important: the payload must match exactly. trumpet rejects a call (400) if a required field is missing or empty, if there's an extra field, or if a Number field arrives as text. amount and account_name may be blank (null). crm_type must be exactly salesforce and crm_object exactly Opportunity; any other value is rejected.


Part 2 — In Salesforce

You'll create a place to store the trumpet key (External Credential), the trumpet address (Named Credential), a Permission Set, and the Flow that sends the event.

Step 3: Store the trumpet API key (External Credential)

  1. Setup → Quick Find Named Credentials → External Credentials tab → New.

  2. Label Trumpet, Name Trumpet (type it — it doesn't fill in from the Label), Authentication Protocol Custom. Save.

  3. Under Principals, click New:

    • Parameter Name Default, Sequence Number 1 → , Identity Type Named Principal.

    • Under Authentication Parameters click Add, Name ApiKey, Value: the trpt_ key from Step 1.

    • Save. Authentication Status shows Unknown — that's normal.

  4. Under Custom Headers, click New

    • Name Authorization

    • Value {!'Bearer ' & $Credential.Trumpet.ApiKey}.

    • Save.

Step 4: Add the trumpet address (Named Credential)

  1. Named Credentials tab → New (not "New Legacy").

  2. Label Trumpet, Name Trumpet.

  3. URL: the start of the Workflow link from Step 2, up to and including the domain (for example https://<your trumpet address>).

  4. External Credential: Trumpet.

  5. Callout Options:

    • Generate Authorization Header: off (you set it yourself in Step 3)

    • Allow Formulas in HTTP Header: on.

    • Save.

Step 5: Give users access to the credential

The Flow needs permission to use the stored key.

  1. Setup → Users → Permission Sets → New. Label Trumpet Flow Callout, License --None--. Save.

  2. Open External Credential Principal Access → Edit → move Trumpet - Default to Enabled → Save.

  3. If your org asks for it, also grant read access to the User External Credentials object.

  4. Click Manage Assignments → Add Assignment, switch to Active Users, tick every user who edits opportunities, then Next → Assign.

  5. Also assign it to your org's default workflow user (Setup → Process Automation Settings). Salesforce runs the Flow's asynchronous path as that user when the person who saved the record can't be used.

Step 6: Build the Flow

  1. Setup → Flows → New Flow. Flow Builder opens in a new browser tab.

  2. In the New Automation dialog, choose Record-Triggered Flow.

  3. In Configure Start:

    • Object: Opportunity.

    • Pick the trigger for your use case:

Use case

Trigger the Flow when

Entry conditions

Stage changed

A record is updated

All Conditions Are Met: Stage · Is Changed · True (optionally add Stage Equals Closed Won)

Record created

A record is created

Optional

Field changed

A record is updated

<your field> · Is Changed · True

  • Record created sends one call when the opportunity is created. Later edits don't send anything.

  • Field changed sends a call only when that field changes. Edits to other fields don't send anything.

  • With an Is Changed condition, Salesforce locks When to Run the Flow for Updated Records. That's expected.

  • Changing the trigger of an existing Flow? If you switch from "A record is updated" to "A record is created", Salesforce keeps the old Is Changed condition and shows "The data type of the resource you entered isn't compatible." Set Condition Requirements to None (or pick a new condition).

  • Leave Optimize the Flow for: Actions and Related Records selected.

  • Switch on Add Asynchronous Path (under "Is this flow making an external callout…"). Salesforce only allows calls to outside systems on this path.

4. Add the call to trumpet: on the Run Asynchronously path, click + → Action, then click Create HTTP Callout at the bottom of the panel.

5. In New HTTP Callout:

  1. Name TrumpetWorkflow, Named Credential Trumpet. Next.

  2. Label Run trumpet workflow, Method POST, URL Path: the rest of the Workflow link, for example /api/v1/workflows/<workflow id>/run. Next.

  3. Sample JSON Request: paste this into the editor and click Review:

{
  "data": {
    "opportunity_id": "006000000000000AAA",
    "opportunity_name": "Acme renewal",
    "stage": "Closed Won",
    "amount": 50000,
    "account_name": "Acme",
    "crm_type": "salesforce",
    "crm_object": "Opportunity"
  }
}

Under Data Structure, change amount from Integer to Double (opportunity amounts can have decimals). Next.

4. Select Sample Response Method: choose Use Example Response. Don't use "Connect for Schema": it sends a real request to trumpet and runs your workflow. Next.

5. Sample JSON Response: paste this, click Review, then Save:

{
  "success": true,
  "data": {
    "dispatchId": "abc",
    "workflowId": "abc",
    "status": "pending",
    "enrolledUserCount": 1,
    "createdAt": "2026-01-01T00:00:00.000Z"
  }
}

Optional: set createdAt to String. The Flow doesn't use it.

6. If the Action panel says "Nothing to set or store here", click ← at the top, search for Run trumpet, and select the action again.

7. In the action panel, set Label Run trumpet workflow. Under Set Request Body, click Value → New Resource. Salesforce fills in Data Type Apex-Defined and the right Apex class. Set API Name TrumpetBody and click Done.

The URL Path may display as null/api/v1/…. That's only how the panel shows it; the call uses your Named Credential's address.

8. Fill in the request body: click + between Run Asynchronously and Run trumpet workflow, and add an Assignment labelled

Build trumpet body.

9. Add one row per field. For each Variable, pick TrumpetBody → data → the field from the list rather than typing it.

Variable

Operator

Value

TrumpetBody > data > opportunity_id

Equals

Triggering Opportunity > Opportunity ID ({!$Record.Id})

TrumpetBody > data > stage

Equals

Triggering Opportunity > Stage ({!$Record.StageName})

TrumpetBody > data > crm_type

Equals

salesforce

TrumpetBody > data > crm_object

Equals

Opportunity

TrumpetBody > data > opportunity_name

Equals

formula OpportunityNameOrDefault

TrumpetBody > data > amount

Equals

Triggering Opportunity > Amount ({!$Record.Amount})

TrumpetBody > data > account_name

Equals

Triggering Opportunity > Account ID > Account Name ({!$Record.Account.Name})

10. Create the name formula from the Value box: New Resource → Formula. It's a safety net: the opportunity name is required by trumpet. A blank Amount or Account is fine, and Salesforce sends it as null. Keep all seven rows in the Assignment. If the Amount or Account name row is left out, trumpet treats that field as blank. Click Check Syntax, then Done.

API Name

Data Type

Formula

OpportunityNameOrDefault

Text

BLANKVALUE({!$Record.Name}, "Untitled opportunity")

Tip: if you type a merge field into a Value box, leave off the closing }. The box adds it for you.

11. Save and switch on: optionally add a Fault path from the action, for example to email your admin {!$Flow.FaultMessage} .

12. Click Save, set Flow Label Trumpet - Opportunity stage changed , and Save.

13. Click Activate.

The Salesforce trigger accepts these seven fields only. Field keys must match exactly, including case. To send other fields, use an API Endpoint trigger instead, where you define the fields yourself.


Part 3 — Test it

  1. In Salesforce, do the thing your Flow listens for, on a test opportunity:

    • Stage changed: change the Stage (for example with Mark as Current Stage).

    • Record created: create a new opportunity.

    • Field changed: change the field you picked. To check the filter works, also change a different field and confirm nothing reaches trumpet.

    Creating an opportunity doesn't fire a "record is updated" Flow, and editing one doesn't fire a "record is created" Flow.

  2. In trumpet, go to Workflows → Workflow history. A new run for your workflow appears within a few seconds and turns Completed shortly after (about 20 seconds in our tests). The list shows runs where you’re an enrolled user. Workspace admins and owners can also see every run in the workspace. The new pod is named after the opportunity and, when the CRM mappings from Recommended workflow actions are set, linked to it. If you set up Find pod and the Conditional step, repeat the same change on the same opportunity: a second run appears and turns Completed, and no second pod is created.

    If a run shows Failed, trumpet doesn't show the reason yet. Contact trumpet support with the run time and the workflow name. A 202 from trumpet only means the run was accepted, not that it will succeed.

  3. Nothing in trumpet? In Salesforce, go to Setup → Paused And Failed Flow Interviews and open the failed interview to see trumpet's error message. An empty list means Salesforce delivered the call successfully.


Recommended workflow actions

The Salesforce trigger only starts the workflow. What happens next depends on the steps you add, and every step runs again on every event. trumpet doesn't stop duplicate pods on its own. The steps below create one pod per opportunity and reuse it on later events. The same pattern works for other triggers that send a CRM record ID, such as HubSpot: map that trigger's own fields instead.

Create one pod per opportunity

  1. Find the deal's pod first. Click the + under the trigger and add a Find pod step. This stops a later event for the same opportunity from creating a second pod.

    • Pod template: click Template (the default is Any), then pick the same template you’ll use in Create Pod from template (item 3). Find pod only looks for pods made from this template.

    • Pod type: the same one you’ll pick in Create Pod from template.

    • Statuses: tick all five (Draft, Active, Closing, Won, Lost). Only Draft and Active are ticked by default. If you leave a status unticked, a deal whose pod has moved to that status gets a new pod on its next event.

    • Owner: Any (the default). Find pod then searches every pod in your workspace, not only the enrolled user’s.

    • Input mappings: CRM record ID ← opportunity_id, CRM type ← crm_type, CRM object ← crm_object.

    Without the CRM mappings, Find pod matches the newest pod of that template in your whole workspace, whatever the opportunity.

  2. Create a pod only when none is found. Click the + under Find pod and add a Conditional step. Name the path No pod yet and set its condition to Find pod → pod_id · Does not exist.

    • Put Create Pod from template, and every later step that needs the new pod, on the No pod yet path. The paths don't join back up after the Conditional, so a step placed below it doesn't see the new pod.

    • Optional: add a second path, Pod found, with Find pod → pod_id · Exists, for steps that should act on the existing pod. Don't put a Create MAP step there: it fails, because the pod already has a MAP.

    • With no matching path, the run ends and shows Completed. That's the normal result for a repeat event.

  3. Open the Create Pod from template step on the No pod yet path and set it up. If the workflow already had one below Find pod, it moves onto that path when you add the Conditional. If not, click the + inside the path to add it.

    • Pod template: choose the template the new pod should copy.

    • Pod type and Pod owner (for example, the enrolled user).

    • Input mappings: map each input to a trigger field:

Step input

Map from

Pod name

opportunity_name

Recipient company

account_name

Deal value

amount (only Number fields are offered)

CRM record ID

opportunity_id

CRM type

crm_type

CRM object

crm_object

  • Leave Template ID, Recipient company domain and Variables empty.

  • If an input shows "Mapping path cannot be empty" and you don't need it, map it to any field, then choose Clear.

    With CRM record ID, CRM type and CRM object all mapped, trumpet links the new pod to the opportunity and pulls its details from the Salesforce integration connected in trumpet. Map all three or none. Mapping only some of them makes the run fail, and trumpet doesn't show why. To clear a test mapping, clear all three.

    Without the three CRM mappings, the pod is still created from the trigger values, but it has no Salesforce link. Template variables that only the Salesforce lookup fills (for example a company name) stay empty.

✓ Check before you enable

  • Find pod's CRM record ID is mapped to opportunity_id.

  • Find pod and Create Pod from template use the same pod template and pod type. If two templates in your workspace share a name, check you picked the same one in both steps.

  • Find pod has all five statuses ticked and Owner set to Any.

  • Create Pod from template, and any step that needs the new pod, sit on the No pod yet path.

  • opportunity_id is the full 18-character Salesforce Id. The Flow in Step 6 sends {!$Record.Id}, which already is. A 15-character Id copied from a report or page address doesn't match the stored pod, so every event creates a new one.

Troubleshooting

Error from trumpet

What it means

Fix

401 Missing Authorization header

The credential header wasn't sent

Check Allow Formulas in HTTP Header is on (Step 4), and the user has the permission set (Step 5)

401 Authorization header must use Bearer scheme

Header sent without Bearer

Re-check the Custom Header formula in Step 3, including the space after Bearer

401 Invalid API key format

The value isn't a trumpet key

Re-paste the full trpt_… key in the External Credential principal

401 Invalid or revoked API key

Key wrong or revoked

Create a new key (Step 1) and update Step 3. Make sure Generate Authorization Header is off

400 Invalid workflow ID format

URL Path has a typo

Re-copy the Workflow link path into the HTTP Callout

404 Workflow not found

Workflow disabled, deleted, wrong ID, or not a Salesforce trigger

Switch on Enable in trumpet; re-copy the URL path

400 mentioning a field name

A field is missing, blank, or the wrong type

Make sure all seven fields are set in the Assignment. Only Amount and Account name may be blank; send numbers as numbers

400 mentioning Unrecognized key

Salesforce sent a field trumpet doesn't expect

Remove it from the Flow. The Salesforce trigger's fields can't be extended

400 Workflow is not fully configured

A step is missing required settings. The message usually lists them

Finish configuring every step in trumpet

400 Workflow contains steps that cannot be run via API yet

The workflow uses a step the API trigger doesn't support yet

Remove or replace that step

422 Workflow enrollment is not configured

The workflow has nobody to run for, or enrollment matches no users

Set enrollment in the workflow

429 Rate limit exceeded. Try again later.

More than 30 calls per minute on one key. Rejected calls count too, except authentication errors (401) and 400 Invalid workflow ID format

Narrow the Flow's entry conditions, or spread bulk updates out

500

Something went wrong on trumpet's side

Try again later. If it keeps happening, contact trumpet support

Run appears but fails

Often the Salesforce integration isn't connected in trumpet

Connect the integration (Settings → Integrations)

Salesforce got 202, then the run shows Failed

The Flow runs in a Salesforce org other than the one connected in Settings → Integrations, so the opportunity isn't found

Run the Flow in the connected org, or connect the org the Flow runs in. Contact trumpet support to confirm

Run fails after you changed the CRM mappings

Only some of CRM record ID, CRM type and CRM object are mapped

Map all three, or clear all three (Recommended workflow actions, item 3)

A second pod appears for the same opportunity

The workflow has no Find pod step, or Find pod didn't match the first pod

Add Find pod and the Conditional step, then check the list under Check before you enable (Recommended workflow actions). If both events arrived within a few seconds of each other, see Current limitations


Current limitations

  • Each event starts a new run. If the same opportunity changes stage twice, the workflow runs twice and every step runs again (for example an email step). Narrow your entry conditions (for example, only Closed Won) if those steps shouldn’t repeat.

  • Pod reuse depends on your workflow setup. trumpet doesn’t stop duplicate pods on its own — a repeat event finds the deal’s pod and skips Create Pod only if you set up the Find pod and Conditional steps from Recommended workflow actions. Without them, every event creates a new pod.

  • Events a few seconds apart can still create two pods — both runs may look for the pod before either has created it.

  • Updating an existing pod isn’t supported yet. A later event can find the pod linked to the opportunity (with Find pod) but can’t change its details, such as stage or amount.

  • The previous stage isn’t sent. Salesforce doesn’t make the old value available on the asynchronous path.

  • Runs go to the workflow’s enrolled users, not the opportunity owner in Salesforce.

  • Bulk updates count against the rate limit — a data import that changes 500 opportunities sends 500 calls.

  • Fixed fields. Amount and Account name can be blank; the other five are required. You can’t add your own fields to the Salesforce trigger.


FAQ

Can trumpet set this up natively instead of a Flow?

Not today. Salesforce doesn't send events to outside apps on its own, and most admins prefer to own their automation. The Flow keeps it in your control.

Will a failed call block the user saving the opportunity?

No. The call runs after the save, on the asynchronous path.

Where is the API key stored?

In the Salesforce External Credential (Step 3), not in the Flow. Only users with the permission set (Step 5) can use it.

Can I trigger on objects other than Opportunity?

Not with the Salesforce trigger — it expects an Opportunity. For other objects, use an API Endpoint trigger and define your own fields.


Need a hand? Reach out via the chat bubble or email our support team. 🎺

Did this answer your question?