Company contact, location and role workflows: Trigger when B2B contacts, locations or roles change
B2B stores sell to companies. Each company has contacts (the customers who buy for the company), locations (the places the company buys for, each with its own addresses) and roles (what each contact is allowed to do at a location, such as "Location admin" or "Ordering only"). With these workflows, you can run actions when a contact, a location or a role changes.
To run actions when the company itself is created, updated or deleted, use a Company workflow instead.
Getting Started
To get started, create a new Event workflow. Under Other Shopify Objects, select one of these cards, then select a trigger:
- Company Contacts
- When a company contact is created: the workflow runs when a customer is added to a company.
- When a company contact is updated: the workflow runs when a contact is changed, for example their job title.
- When a company contact is deleted: the workflow runs when a contact is removed from a company.
- Company Locations
- When a company location is created: the workflow runs when a location is added to a company.
- When a company location is updated: the workflow runs when a location is changed, for example its address.
- When a company location is deleted: the workflow runs when a location is removed.
- Company Contact Roles
- When a company contact role is assigned: the workflow runs when a contact is given a role at a location.
- When a company contact role is revoked: the workflow runs when a contact's role at a location is removed.
These triggers are only for Event workflows. You cannot use them in scheduled, bulk operation or on-demand workflows.
Note: When a contact or a location is deleted, Shopify sends only its ID, because it no longer exists. Its name, company and other details are not available. On the Activity page, these runs are titled with the ID, for example "Deleted location #14016446753" or "Deleted contact #5362319649". Use {{ company_location.id }} or {{ company_contact.id }} in your actions.
Note: If one of your workflows adds customers to companies or changes roles, it can start these workflows too. To skip the changes that Arigato's own actions cause, use the Ignore webhooks triggered by Arigato workflow actions setting in the workflow settings.
Company Contact Data
A contact has no name of its own. Its name is the name of its customer. Use these values in conditions and actions, or find them in the Token Browser:
{{ company_contact.customer_name }}: the customer's name, for example "Karine Ruby".{{ company_contact.title }}: the contact's job title, if it has one.{{ company_contact.isMainContact }}:truewhen the contact is the company's main contact.{{ company_contact.locale }}and{{ company_contact.createdAt }}: the contact's language and the date it was added.{{ company_contact.customer }}: the full customer, with the same fields as a customer workflow, for example{{ company_contact.customer.email }}.{{ company_contact.company }}: the full company, for example{{ company_contact.company.name }}.
Company Location Data
{{ company_location.name }}: the location's name.{{ company_location.billingAddress }}and{{ company_location.shippingAddress }}: the addresses, for example{{ company_location.shippingAddress.city }}.{{ company_location.note }},{{ company_location.externalId }}and{{ company_location.taxRegistrationId }}.{{ company_location.ordersCount.count }}and{{ company_location.totalSpent.amount }}: the location's number of orders and the amount it has spent.{{ company_location.company }}: the full company, for example{{ company_location.company.name }}.- The location's metafields, in the Token Browser under Defined Metafields.
Company Contact Role Data
A role is what a contact is allowed to do at a location. Shopify has two: Location admin (can place orders and manage the location) and Ordering only (can place orders for the location). On the Activity page, a role run is titled with the contact, the role and the location, for example "Karine Ruby: Ordering only role at Snowdevil".
A role workflow has the role, the contact and the location together:
{{ company_contact_role.name }}: the role, for example "Location admin" or "Ordering only".{{ company_contact_role.company_contact }}: the contact, for example{{ company_contact_role.company_contact.customer_name }}.{{ company_contact_role.company_location }}: the location, for example{{ company_contact_role.company_location.name }}.{{ company_contact_role.company }}: the full company.
For example, this message says who got which role, and where:
{{ company_contact_role.company_contact.customer_name }} is now {{ company_contact_role.name }} at {{ company_contact_role.company_location.name }} ({{ company_contact_role.company.name }}).
Actions
In the action list, under Shopify, you can run actions on the objects linked to the trigger. For example, a contact workflow has Company Contact / Customer actions (such as adding a tag to the customer) and Company Contact / Company actions. A location workflow has Company Location actions, such as setting a location metafield.
Testing
To test a workflow, open the Data Inspector and search for a test object. Shopify does not let apps search contacts or roles directly, so:
- For a contact, search by company name. The list shows the contacts of the companies that match.
- For a role, search by company location. The list shows the roles at the locations that match.
Specify Conditions
Use a condition so that the workflow runs only when you want. For example, the condition Company Contact Role → Role Name equals Location admin runs the workflow only when someone becomes a location admin.