---
title: "SignNow Invite Status Update event"
url: "https://docs.signnow.com/docs/apex-invite-status-update-event"
type: "page"
section: "Integrations"
slug: "apex-invite-status-update-event"
---

# SignNow Invite Status Update event

# SignNow Invite Status Update event

> Before configuring this Apex action, review the [prerequisites](/docs/salesforce-apex-actions#prerequisites) for SignNow Apex actions and complete the required setup steps.

Users can trigger actions in Salesforce based on SignNow document group events. 

SignNow also stores invite and recipient status as Salesforce records. For those objects, their fields and status values, see [Signing status and record updates](/docs/salesforce-signing-status-and-record-updates).

The supported event types are: 

- `document_group.complete`
- `document_group.update`
- `document_group.delete`
- `document_group.invite.create`
- `document_group.invite.update`
- `document_group.invite.cancel`
- `document_group.invite.declined`
- `document_group.invite.signed`
- `document_group.invite.resend`
- `user.invite.expired`

Each event carries the following fields.

| Field | API name | Type | Description |
| --- | --- | --- | --- |
| Event Type | `cuda_signnow__Event_Type__c` | Text(255) | The event that fired, for example `document_group.invite.signed` |
| Invite ID | `cuda_signnow__Invite_ID__c` | Text(255) | The SignNow invite the event relates to |
| Context ID | `cuda_signnow__Context_ID__c` | Text(255) | The ID of the Salesforce record the invite was sent from |
| Context Table | `cuda_signnow__Context_Table__c` | Text(255) | The API name of that record's object, for example `Opportunity` |
| Initiator ID | `cuda_signnow__Initiator_ID__c` | Text(255) | The user who caused the event |
| Timestamp | `cuda_signnow__Timestamp__c` | Date/Time | When the event occurred in SignNow |
| JSON | `cuda_signnow__JSON__c` | Long Text Area(131072) | Remaining event-specific data, such as signer details or `group_invite_id` |

**Context ID** and **Context Table** together identify the Salesforce record behind the invite. Match on them to find the Opportunity, Account, or custom object record to update.

Salesforce adds its own standard fields to every platform event, including `EventUuid`, `ReplayId`, `CreatedDate` and `CreatedBy`. `CreatedDate` is when Salesforce published the message, which is not the same as `Timestamp`, the moment the event occurred in SignNow.

Platform events are delivered at least once, so a flow that writes to a record can run twice for the same event. Where a repeated update would cause a problem — advancing a stage, sending a notification, incrementing a value — store the `EventUuid` and skip messages you have already handled.

## Step 1. Configure a flow

Let’s configure the flow to update Opportunity records based on the Invite Status Update data.

This time, it will be a platform event.

![apex_signnow_event_platform_triggered.png](/reference-assets/images/SignNow_Salesforce/apex_actions/apex_signnow_event_platform_triggered.png)

Configure the platform event details.

- Name the event.
- Select the flow initiator.

**Run this flow as** sets the identity the flow runs under. *User that triggered the event* uses whoever's context published the message, which varies with how the invite was sent. *Default Workflow User* is the same identity every time, set in **Setup > Process Automation Settings**. Either way, give that user edit access to the records the flow updates.

![apex_signnow_event_trigger.png](/reference-assets/images/SignNow_Salesforce/apex_actions/apex_signnow_event_trigger.png)

Configure the flow’s decision.

- Add a label and name.
- Add a short description (optional).
- Specify the outcomes and conditions. For our example, the event will be triggered if the object is Opportunity.

![apex_signnow_event_decision.png](/reference-assets/images/SignNow_Salesforce/apex_actions/apex_signnow_event_decision.png)

## Step 2. Configure the Update Records action

Next, configure the **Update Records** action.

- Add a label and name.
- Specify how to find the records to update. For our example, we will set conditions for field updates.
- Specify the object to update.
- Add condition requirements for record update.
- Map field values for Opportunity records. For our example, the `Description` field of the Opportunity will be pre-filled with `Event Type` of the SignNow event, and the `Next Step` field will be pre-filled with `Invite ID`.

![apex_signnow_event_update_records.png](/reference-assets/images/SignNow_Salesforce/apex_actions/apex_signnow_event_update_records.png)

Once the configuration is ready, click **Save** and activate the flow.

## Result

Each time the signature invite is sent or changes its status, the `Next Step` and `Description` fields are pre-filled with SignNow event data (invite ID and event type).

![apex_signnow_event_result.png](/reference-assets/images/SignNow_Salesforce/apex_actions/apex_signnow_event_result.png)

## Update the Opportunity stage after each signer signs

When a template goes to several signers in sequence, you can advance the linked Opportunity stage as each one completes: the first signer moves the Opportunity to **Value Proposition**, the second to **Negotiation/Review**, and the last to **Closed Won**.

The Invite Status Update event carries invite-level facts (event type, invite ID, and Context ID), enough to update one field per invite. Setting a different stage for each signer needs the signer's position in the signing order, which lives on the **SignNow Signer** record. So this use case runs on a record-triggered flow on that object, and resolves the Opportunity through the invitation the signer belongs to.

SignNow creates one **SignNow Signer** record per recipient when an invite is sent, holding that recipient's email, status, signing order, and a master-detail relationship to the **SignNow Invitation** record for the send. The flow below runs against those records as each signer completes.

### Step 1. Create a record-triggered flow

In Salesforce Setup, open **Flows**, then create a **Record-Triggered Flow** with the following configuration.

- **Object**: `SignNow Signer` (`cuda_signnow__SignNow_Signer__c`)
- **Trigger the Flow When**: A record is updated
- **Condition Requirements**: All Conditions Are Met (AND)
- **Entry condition**: `Status` Equals `Signed`
- **When to Run the Flow for Updated Records**: Only when a record is updated to meet the condition requirements
- **Optimize the Flow for**: Actions and Related Records

![apex_signnow_signer_flow_trigger.png](/reference-assets/images/SignNow_Salesforce/apex_actions/apex_signnow_signer_flow_trigger.png)

The entry condition keeps the flow from running on every signer update, so it executes once per signer, at the moment that signer completes the document.

### Step 2. Add a formula resource for the target stage

In the Toolbox, click **New Resource** and add a formula that maps each signer's position in the signing order to the stage you want the Opportunity to reach.

- **Resource Type**: Formula
- **API Name**: `New_opportunity_status`
- **Data Type**: Text
- **Formula**:

```
IF({!$Record.cuda_signnow__Order__c}=1, "Value Proposition",
IF({!$Record.cuda_signnow__Order__c}=2, "Negotiation/Review",
"Closed Won"))
```

Click **Check Syntax** to validate the formula, then click **Done**.

![apex_signnow_signer_flow_formula.png](/reference-assets/images/SignNow_Salesforce/apex_actions/apex_signnow_signer_flow_formula.png)

The `Order` field holds the signer's position in the invite, so the formula returns `Value Proposition` for the first signer, `Negotiation/Review` for the second, and `Closed Won` for everyone after that. Use the stage names defined in your own Opportunity **Stage** picklist, and add a nested `IF()` for each additional signer you want to branch on. To branch by recipient instead of by order, use the signer's `Email` field in place of `Order`.

### Step 3. Add an Update Records element

Add an **Update Records** element that writes the stage to the Opportunity the invite was sent from.

- **Label**: `Update Opportunity`
- **How to Find Records to Update and Set Their Values**: Specify conditions to identify records, and set fields individually
- **Object**: `Opportunity`
- **Condition Requirements to Update Records**: All Conditions Are Met (AND)
- **Filter**: `Opportunity ID` Equals `SignNow Invitation > Context ID`
- **Set Field Values**: `Stage` = `New_opportunity_status`

![apex_signnow_signer_flow_update_opportunity.png](/reference-assets/images/SignNow_Salesforce/apex_actions/apex_signnow_signer_flow_update_opportunity.png)

**Context ID** on the related SignNow Invitation record holds the ID of the Salesforce record the invite was sent from. Matching it against `Opportunity ID` is how the flow resolves the right Opportunity.

Click **Save**, then click **Activate**.

### Result

Each signer who completes the document advances the linked Opportunity one stage, and the final signer moves it to the closing stage you defined.

---

View the full list of [SignNow Apex actions](/docs/salesforce-apex-actions).

---
*Full page: https://docs.signnow.com/docs/apex-invite-status-update-event*
