Automatically Create Advocacy Board Repost Stories from Published LinkedIn Posts and notify the admin
Use a Custom Agent to automatically turn a newly published LinkedIn post into a draft Repost Story on an Employee Advocacy board. This scenario applies to all posts published in the Publishing module, assigns the story to one topic, and creates no message ideas. As soon as the Repost Story is created, an email notification is sent to the admin.
Prerequisites
- An Employee Advocacy board set up to receive stories
- A LinkedIn social profile connected to your Oktopost account
- Access to the Custom Agent builder
Step 1: Create the Trigger Event
- Open Custom Agents and click + New.
- Name the flow (for example, "Corporate Posts to Repost Stories").
- Add an Event node.
- Select Post Sent as the trigger event.
Step 2: Filter for the Right Posts
Add a Filter node so the flow only continues for posts that match your network or any other conditions, such as campaign, tag, or profile.
- Add a Filter node after the Event node.
- Add a condition: Network Equals LinkedIn.
- Optionally, add additional AND or OR conditions such as Campaign, Tag, or other fields.
- Connect the Yes output to the next step.
Step 3: Retrieve the Post and Message Details
- Add an Oktopost Action node and set the tool to
get_social_post. - Set
postlogIdto the triggering event's post log ID. - Add another Oktopost Action node and set the tool to
get_post. - Set
postIdto the event's post ID. - Add an Oktopost Action node and set the tool to
get_message_by_id. - Set
messageIdto the event's message ID to retrieve the post's body text and link.
Step 4: Retrieve the Campaign Details
- Add an Oktopost Action node and set the tool to
get_campaign_by_id. - Set
campaignIdto the event's campaign ID.
Step 5: Retrieve the Board and Its Topics
- Add an Oktopost Action node and set the tool to
get_board. - Set
boardIdto the ID of the advocacy board that will receive the story. - Add an Oktopost Action node and set the tool to
list_board_topics. - Set
boardIdto the same board ID. - Optionally, set
qto search for a specific topic by name (for example, "Corporate news").
Step 6: Create the Advocacy Board Story
- Add an Oktopost Action node and set the tool to
create_board_story. - Set
boardIdto the target board ID. - Set
campaignIdto the campaign ID retrieved in Step 4. - Set
postlogIdto the triggering post's log ID. When this is set, the title and description are derived automatically, and the link, media, and message fields are ignored. - Set
topicIdsto the topic ID(s) found in Step 5, if the board has topics. - Set
isDraftto true to review the story before it goes live, or false to publish it immediately. - Leave
publishDatetimeandexpirationDatetimeblank to use the defaults, or set them to schedule the story.
create_board_story Parameters
| Parameter | Required | Type | Notes |
|---|---|---|---|
| boardId | Yes | string | Board ID, starts with brd |
| title | Conditional | string | Required unless postlogId is set |
| description | Conditional | string | Required unless postlogId is set |
| campaignId | Yes | string | Campaign to associate with the story |
| postlogId | No | string | LinkedIn post log ID for a repost story; auto-derives title and description |
| mediaIds | No | string | Comma-separated media IDs |
| link | No | string | Link URL for the story |
| messageIds | No | string | Comma-separated pre-written message IDs |
| topicIds | Conditional | string | Required if the board has existing topics |
| tagIds | No | string | Comma-separated tag IDs |
| publishDatetime | No | number | Unix timestamp; defaults to now |
| expirationDatetime | No | number | Unix timestamp; defaults to the board's default expiration |
| isDraft | No | boolean | Defaults to false; set true for drafts |
| isFeatured | No | boolean | Defaults to false |
Step 7: Send Email Notification
- Add a new Email step node.
- Set the recipient email and any other optional configuration.
Configure the email content structure:
- Start with an optional email introduction and template.
- Embed the link to the newly created Repost Story by copying the provided link exactly:
https://app.oktopost.com/{{nodes.<create-board-story-node-id>.output.content.Item.BoardId}}/stories/{{nodes.<create-board-story-node-id>.output.content.Item.ID}}
Replace <create-board-story-node-id> with the node ID of your create_board_story action. Use the variable picker in the Email step to select the correct output instead of typing the node ID manually.
Highlight the text New Repost Story:
Click the hyperlink symbol at the top:
Paste the URL in the pop-up box and click OK:
Step 8: Save and Activate the Flow
- Click Save to save your progress.
- Review each node to confirm the field mappings are correct.
- Click Set Active to turn on the flow.
Once active, the flow runs automatically every time a matching LinkedIn post is published, creating a corresponding Repost Story on your advocacy board and sending an instant notification with a link to the story ready for admin review.