The Salesforce → Stigg provisioning integration and the Stigg → Salesforce sync are independent. You can use either one on its own, or both together. The Stigg → Salesforce sync does not require the Stigg app for Salesforce to be installed.
How it works
1
Something happens in Stigg
A workflow trigger starts the workflow. Usually this is a Stigg event such as
subscription.trial_started or entitlement.usage_exceeded, or an On a schedule trigger for periodic syncs.2
The workflow decides what to sync
Optional condition nodes filter the events you care about (for example, only trials on your Pro plan), and Stigg action nodes fetch any extra data you need (for example, the customer’s current entitlements).
3
The Salesforce node writes to Salesforce
A Salesforce action node creates, updates or upserts a record in Salesforce: a Lead, Contact, Account, Opportunity, Task, or any custom object.
Example use cases
Prerequisites
- Access to Stigg Workflows. Workflows are currently in beta; to request access, contact Stigg Support.
- A Salesforce edition with API access, such as Enterprise, Unlimited, or Developer Edition.
- A Salesforce user that can authorize the connection and has API Enabled on their profile or permission set, plus read and write access to the objects your workflows will update.
- A Salesforce admin that can create an External Client App, and any custom fields you want to sync Stigg data into.
Step 1: Connect Salesforce to Stigg Workflows
The Salesforce node authenticates with a Salesforce credential. Credentials are stored per Stigg environment, so you’ll need to create one in each environment (for example, once for development and once for production). See Managing credentials.1
Start creating the credential in Stigg
In the Stigg app, go to Workflows and open the Credentials tab. Create a new credential and select Salesforce OAuth2 API.You can also do this the first time you add a Salesforce node to a workflow: select Create new credential in the node’s credential dropdown.Copy the URL shown at the top of the credential dialog. This is the OAuth callback URL, and you’ll need it in the next step. Keep the dialog open.
2
Create an External Client App in Salesforce
In Salesforce, go to Setup, search for External Client App Manager, and click New External Client App.Under Basic Information, enter a name (for example,
Stigg Workflows) and a contact email, and set Distribution State to Local.Under API (Enable OAuth Settings), select Enable OAuth and set:Leave the default Security settings, including Require Proof Key for Code Exchange (PKCE), as they are. Then click Create.
3
Copy the Consumer Key and Secret
On the app’s page, open the Settings tab, expand OAuth Settings, and click Consumer Key and Secret. Salesforce emails you a verification code before it shows them.Use the Copy buttons to copy the Consumer Key and Consumer Secret. The key contains look-alike characters, so copying it by hand can introduce errors.
4
Finish the credential in Stigg
Back in the Stigg credential dialog, set:
Click Save, then click Connect my account. Sign in to Salesforce with the user the workflow should act as, and click Allow. Records created by the workflow will show this user as their creator.
Depending on your org, some of the app’s Security settings are selected and locked, with the message To change this required setting, contact Support. These can include PKCE, refresh token rotation, and a 30-day limit on idle refresh tokens. With the 30-day limit, the connection expires if no workflow uses it for 30 days, and you need to reconnect the credential in Stigg.
Troubleshooting the connection
Step 2: Prepare Salesforce to receive Stigg data
Decide where Stigg data should live in Salesforce, and create any custom fields you need before building the workflow. Common choices are:If you also use the Salesforce → Stigg provisioning integration, the Stigg app for Salesforce already adds a Stigg Customer ID field to the Account object. Reuse it to look up Accounts from your workflows.
Use the Stigg customer ID as an External ID
Workflows can run more than once for the same customer (for example, a customer can start a second trial, or an event can be retried). To avoid creating duplicate records, add a Stigg Customer ID text field to every object you create records on, and mark it as Unique and External ID in Salesforce. With an External ID field in place, the Salesforce node can use the Create or Update operation, which updates the existing record if one with the same Stigg customer ID exists, and creates a new one otherwise.Create the custom fields
Create each field on the object it belongs to, for example Account or Lead:1
Open the object's fields
In Salesforce Setup, click Object Manager, select the object, then select Fields & Relationships and click New.
2
Choose the field type
Select the data type, and click Next. Use Text for IDs, names and statuses, Date/Time for dates, Number for usage values, and Text Area (Long) for longer summaries such as entitlements.
3
Enter the field details
Enter the Field Label, for example
Stigg Customer ID, and a Length of 255 for text fields. Keep the Field Name that Salesforce fills in, because workflows refer to the field by its API name (for example, Stigg_Customer_ID__c).For the Stigg Customer ID field, also select Unique with Treat “ABC” and “abc” as different values (case sensitive), and select External ID. Click Next.4
Set field-level security
New fields are hidden from all profiles unless you select them here. Select Visible for the profile of the user you connected in Step 1, and leave Read-Only cleared. Also select Visible for the profiles your Sales team uses, so they can see the field. Click Next.
5
Add the field to page layouts
Keep the object’s default layout selected, and click Save & New to add the next field, or Save after the last one.
If the connected user can’t edit a field, Salesforce rejects the workflow’s request. If a sync fails with a field access error, check the field’s field-level security.
Step 3: Build the workflow
1
Create a workflow and add a trigger
In the Stigg app, go to Workflows and click Start from scratch (see Workflow creation).Add a Stigg Event Trigger. In Credential to connect with, select your Stigg API key credential (see Managing credentials). Under Events, select the event to react to, for example Subscription Trial Started (
subscription.trial_started).For periodic syncs, use the On a schedule trigger instead.2
Add sample data
In the trigger’s Output panel, click set mock data and paste a sample event payload. Later nodes can then reference the event’s fields without waiting for a real event. See Webhook events for the payload of each event.
3
Filter the events you care about
Add an If node to continue only for relevant events. For example, to sync only trials on your Pro plan, set the condition to:
To fill in value1, drag the field from the Input panel, or type the expression. See Expressions for more examples.
4
Add a Salesforce node
Click + on the true branch of the condition, search for Salesforce, and select the action you need, for example Create or update a lead.Select the Salesforce credential you created in Step 1. The node fills in Resource and Operation from the action you picked.
5
Map Stigg data to Salesforce fields
Fill in the node’s fields with values from the trigger. You can drag fields from the input panel on the left into the node’s parameters, or type an expression, for example
{{ $json.customer.email }}.Under Additional Fields > Custom Fields, map values into your custom fields by their API name.For Create or Update operations, Match Against lists the External ID fields on the Salesforce object. The list loads from Salesforce, so the field must already exist and the credential must be connected.6
Test the workflow
Send a test event from the trigger node (see Manual trigger & test events), or perform the action in Stigg (for example, start a trial for a test customer).Check that the record was created or updated in Salesforce as expected, and review the run in the workflow execution history.
7
Activate the workflow
Once the workflow behaves as expected, activate it. From this point on, it runs every time the trigger fires.
Matching Stigg customers to Salesforce records
Before updating an existing record, the workflow needs to know which Salesforce record belongs to the Stigg customer. Use one of the following approaches:
Example SOQL lookup:
If a lookup returns no records, the nodes after it won’t run for that event. If you want to handle customers that aren’t in Salesforce yet (for example, by creating a Lead instead), enable Always Output Data in the Search node’s settings and add an If node that checks whether an
Id was returned.Things to keep in mind
- Error handling: if Salesforce rejects a request (for example, because a required field is missing or the credential expired), the workflow run fails and shows up in the execution history. See Error handling to get notified about failures.
- Required fields: Salesforce enforces required fields and validation rules on records created through the API. For example, a Lead requires Last Name and Company.
- API limits: every Salesforce node call counts toward your org’s daily API request limit. For high-volume events, filter early in the workflow, and prefer scheduled syncs over syncing on every event.
- Environments: workflows and credentials are scoped to a Stigg environment. Point your development environment at a Salesforce sandbox and your production environment at your production org.
Next steps
Examples
Step-by-step recipes for common Stigg → Salesforce syncs.
Workflow actions
All Stigg actions you can combine with the Salesforce node.