Manage Instagram story replies using a workflow
Last Update: Oct 2024 • Est. Read Time: 3 MINInstagram stories allow you to post photos or videos that automatically disappear within 24 hours. This feature includes the Reply option, which allows users to reply to your stories.
If you have Instagram integrated in your instance, these story replies will be created as Instagram direct messages
(IG DMs).
You may want to process story replies differently from other types of direct messages.
For this, you can use a workflow to manage story replies.
Who can access this feature? | |
User types | Admins can access the Workflows page. |
In this article:
Prerequisites
Before following this guide, we recommend that you already be comfortable with the basics of using workflows. See Workflows Overview for more information.
Create the Workflow
You can create custom workflows from the Kustomer app.
To create a workflow:
- Go to Settingsand select Platform > Workflows.
- Select Add Workflow > Custom Workflow. The New Workflow window opens.
- Enter a Workflow Title and add your own description for the workflow in the Description field.
- Select Create to save the workflow and begin working in the Workflow Editor.
Enter the Workflow JSON code
Use the Workflow Editor to paste in the workflow code supplied below. This JSON code will identify Story Reply messages and allow you to update the conversations those messages are created in.
- In the Workflow Editor, go to Workflow Optionsand select Edit Workflow JSON.
- A window opens where you can edit the code for this workflow directly. Select and delete all the current JSON code.
- Copy the code block below, and paste it into the JSON text field in your Workflow Editor. Then, select Update to dismiss the JSON editor and save the changes to the workflow.
{ "description": "", "name": "instagram-story-replies", "steps": [ { "transitions": [ { "target": "YL7tWDGA3", "condition": { "op": "contains", "values": [ "/#steps.1.meta.messageType", "storyReply" ] }, "meta": { "name": "Is a Story Reply" } } ], "errorCases": [], "id": "85csR397j" }, { "transitions": [ { "target": "oLHIQR1F7", "condition": { "op": "exists", "values": [ "/#steps.YL7tWDGA3.id", "" ] }, "meta": { "name": "Conversation Found" } } ], "errorCases": [], "id": "YL7tWDGA3", "action": "kustomer.conversation.find-by-id", "params": { "id": "/#steps.1.conversation" }, "meta": { "displayName": "Find Conversation" }, "appVersion": "kustomer-^1.9.2" }, { "transitions": [], "errorCases": [], "id": "oLHIQR1F7", "action": "kustomer.conversation.update", "params": { "id": "/#steps.YL7tWDGA3.id" }, "meta": { "displayName": "Update Conversation" }, "appVersion": "kustomer-^1.9.2" }, { "transitions": [ { "target": "85csR397j", "condition": { "op": "eq", "values": [ "/#steps.1.channel", "instagram" ] }, "meta": { "name": "Is an Instagram Message" } } ], "errorCases": [], "id": "scM9jq52e" } ], "trigger": { "transitions": [ { "target": "scM9jq52e", "condition": { "op": "eq", "values": [ "/#steps.1.direction", "in" ] }, "meta": { "name": "Is an Inbound Message" } } ], "eventName": "kustomer.message.create", "id": "1", "appVersion": "kustomer-^1.9.2" } }
The workflow will look like the image below.
Customize the workflow
You can add the changes you'd want the workflow to make on the conversation the Update Conversation step. You can also change this step if you want to update the message or another object instead.
When you're finished, Save all and other workflow changes, and use the toggle to activate the workflow.