Use a Custom Agent to automatically turn newly published LinkedIn posts from a specific campaign into draft Repost Stories on an Employee Advocacy board. This workflow keeps corporate content flowing to advocates without manual story creation, so employees can share timely updates as soon as posts go live.
Prerequisites
- Access to the Custom Agent builder
- A LinkedIn social profile connected to your Oktopost account
- A Social Media Management campaign already created in Oktopost
- An Employee Advocacy board configured to receive stories
Create the Trigger Event
From the main Oktopost dashboard, open Custom Agents from the left sidebar.
- Click + New.
- Name the flow (for example, "Corporate News Posts to Repost Stories").
- Add an Event node.
- Select Post Sent as the trigger event.
Filter for the Right Posts
Add a Filter node so the flow only continues for posts that match your campaign and network.
- Add a Filter node after the Event node.
- Set the condition logic to AND.
- Add a condition: Network Equals LinkedIn.
- Add a second condition: CampaignId Equals your campaign ID.
- Connect the Yes output to the next step.
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.
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.
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").
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.
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 the previous step. - 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 the previous step, 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 |
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.