Automatically Create Advocacy Board Repost Stories from Published LinkedIn Posts and notify the admin

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

  1. Open Custom Agents and click + New.
  2. Name the flow (for example, "Corporate Posts to Repost Stories").
  3. Add an Event node.
  4. 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.

  1. Add a Filter node after the Event node.
  2. Add a condition: Network Equals LinkedIn.
  3. Optionally, add additional AND or OR conditions such as Campaign, Tag, or other fields.
  4. Connect the Yes output to the next step.

Step 3: Retrieve the Post and Message Details

  1. Add an Oktopost Action node and set the tool to get_social_post.
  2. Set postlogId to the triggering event's post log ID.
  3. Add another Oktopost Action node and set the tool to get_post.
  4. Set postId to the event's post ID.
  5. Add an Oktopost Action node and set the tool to get_message_by_id.
  6. Set messageId to the event's message ID to retrieve the post's body text and link.

Step 4: Retrieve the Campaign Details

  1. Add an Oktopost Action node and set the tool to get_campaign_by_id.
  2. Set campaignId to the event's campaign ID.

Step 5: Retrieve the Board and Its Topics

  1. Add an Oktopost Action node and set the tool to get_board.
  2. Set boardId to the ID of the advocacy board that will receive the story.
  3. Add an Oktopost Action node and set the tool to list_board_topics.
  4. Set boardId to the same board ID.
  5. Optionally, set q to search for a specific topic by name (for example, "Corporate news").
If the board has existing topics, you must pass at least one matching topic ID when you create the story in the next step, or the request will fail. Checking topics first avoids this error.

Step 6: Create the Advocacy Board Story

  1. Add an Oktopost Action node and set the tool to create_board_story.
  2. Set boardId to the target board ID.
  3. Set campaignId to the campaign ID retrieved in Step 4.
  4. Set postlogId to 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.
  5. Set topicIds to the topic ID(s) found in Step 5, if the board has topics.
  6. Set isDraft to true to review the story before it goes live, or false to publish it immediately.
  7. Leave publishDatetime and expirationDatetime blank 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

  1. Add a new Email step node.
  2. Set the recipient email and any other optional configuration.
Email step configuration in Custom Agents

Configure the email content structure:

  1. Start with an optional email introduction and template.
  2. 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:

Highlighted New Repost Story text in the email editor

Click the hyperlink symbol at the top:

Hyperlink button in the email editor toolbar

Paste the URL in the pop-up box and click OK:

Insert hyperlink dialog in the email editor
Remove the section highlighted in red in the email body if you copied the URL link from the agent rather than from this article.

Step 8: Save and Activate the Flow

  1. Click Save to save your progress.
  2. Review each node to confirm the field mappings are correct.
  3. 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.

Completed Custom Agent flow for Repost Stories with email notification
Was this article helpful?
0 out of 0 found this helpful