Salesforce

CRM OAuth

Read and write Salesforce records and run SOQL and SOSL queries from any Windmill script, flow or app.

Set up in 3 steps

1

Connect from the Resources page

Open Resources, click Add a resource/API and pick salesforce under Instance-configured OAuth APIs; sandbox orgs have their own tile. Click Connect and sign in.

2

Check the instance URL

Connect fills instance_url, your org's My Domain URL such as https://acme.my.salesforce.com, under Connection details: every call goes to that host. Leave api_version empty unless you need to pin one.

3

Run your first script

Fork any script below and read before writing anything.

Scripts

Building blocks, if none of the projects above fit. Fork one, run it, or call it as a step inside your own flow.

Submit a script →

Trigger flows from Salesforce

Salesforce is not only a destination. These inbound paths are supported today.

New or updated record (scheduled poll)

The New or Updated Record trigger script polls one object (Lead, Account, a custom object) and returns the records modified since its last run. To run it, open a flow, add a trigger and choose Scheduled Poll, then pick the trigger script and an interval. The steps after it run once per new item, and each flow keeps its own cursor.

Resource type

The shape of the credential every script on this page expects.

FieldTypeRequiredWhat it is
api_versionstringNoSalesforce REST API version path segment, e.g. v60.0. Optional — scripts default to v60.0 when left blank.
instance_urlstringYesOrg data host returned in the OAuth token response, e.g. https://acme.my.salesforce.com (production) or https://acme--sandbox.sandbox.my.salesforce.com (sandbox). Every REST call is made against this host, not login.salesforce.com.
tokenstringYesOAuth access token. Populated by Windmill's OAuth flow.

Questions

Sandbox or production?

Separate tiles, separate sign-in hosts. The saved resource keeps the same type either way, so scripts do not fork.

There is no Connect button on my instance

A Windmill instance admin has to add a Salesforce connected app's consumer key and secret once, under Instance settings → Auth/OAuth/SAML → OAuth (and salesforce_sandbox for sandbox orgs). Until then there is no tile.

Is my token stored on the hub?

Never. It lives only in your own Windmill workspace, encrypted at rest.