This article shows you how to build a Custom Agent that turns each published post into a draft Advocacy Story, complete with media, a title, description, tags, topic, and ready-to-share LinkedIn message ideas.
Prerequisites
- Access to Oktopost Custom Agents
- An existing Employee Advocacy board with Topics already configured
- Permission to create and edit Stories
- The board ID you want Stories added to
How the Flow Works
The Flow uses four nodes that run in sequence. Each node passes its output to the next.
| Node | Type | Purpose |
|---|---|---|
| Post Created | Event | Triggers the Flow when a post is created |
| Filter | Filter | Limits the Flow to posts that meet your conditions |
| get_post | Oktopost Action | Retrieves the full data for the created post |
| AI Action | AI Action | Builds and saves the draft Story from the post data |
Step 1: Add the Trigger Event
- Open Custom Agents and create a new flow.
- Add an Event node.
- Select Post Created as the event.
Step 2: Add a Filter
Use a filter so only the posts you want become Stories.
- Add a Filter node after the event.
- Set the match type to AND so every condition must be met.
- Add your conditions (for example, campaign, network, or tag).
- Connect the Yes output to the next node.
Step 3: Retrieve the Post Data
- Add an Oktopost Action node.
- Select the get_post action.
- Pass the Post ID from the event into the action.
This step returns the post's campaign, tags, publish date, media, and text for the AI Action to reuse.
Step 4: Configure the AI Action
Add an AI Action node and paste the instruction prompt below into its Instructions field. The sections that follow explain what each part of the prompt does.
Story Settings
The AI Action creates the Story on your board and reuses values from the post it just retrieved.
| Field | Value |
|---|---|
| Board | Your target board ID |
| Campaign | Same as the post |
| Publish Date | Same as the post |
| Expiry Date | Default |
| Tags | Same as the post |
| Topic | Matched to the post text — no new Topics created |
Story Preview
The preview is populated from the post content:
- Media — the same image or video as the post
- Title — up to 15 words, built from key elements of the original text
- Description — one sentence of about 50 words summarising the original text
LinkedIn Message Ideas
The AI Action adds three message ideas that employees can reshare. Each idea follows these rules:
- Written in a professional but casual, personable tone with no emojis
- Two paragraphs, each up to 300 characters
- Based only on the original post content — no invented facts
- Ends with the post URL and an encouraging call to action, but only if a URL is present in the post
- Includes the same media (image, video, or PDF) as the original post
Story Status
When the Story is created, its status is set to Draft so you can review it before publishing.
AI Action Prompt
Paste this into the Instructions field. Replace brd5vl02i2casik with your board ID. Node reference IDs such as {{nodes.oktopost-events_1782398047161.output.Id}} are flow-specific templates — update them to match your flow.
Retrieve the data about the sent post by finding Post ID {{nodes.oktopost-events_1782398047161.output.Id}}.
Create a new Story inside board ID 'brd5vl02i2casik'.
- Campaign to be the same as in the Get_post.
- Publish Date = the same as in the Get_post.
- Expiry Date = Default.
- Tags = same as in the Get_post.
- Topic = associate the right Topic based on text context. Do not create new Topics.
Populate Story Preview with:
- Same image or video as in the Get_post.
- Add a Title that is up to 15 words - use key elements from the original text.
- Add a Description that contains one sentence of 50 words summarising the original text.
Add 3 LinkedIn Message Ideas. Criteria:
- Write in a professional but casual tone, personable. No emojis.
- 2 paragraphs of up to 300 characters each.
- Create text about the original post content, do not invent any new facts.
- Add the URL link at the bottom of the text with a call to action that is professional but encouraging, but only if it is provided in the original Get_post text.
- Add the same image/images/video/pdf in the messages as in the original Get_post media.
- These messages will be reshared by employees, so ensure they sound engaging and contain the original text from the post with tweaks as per above.
When a Story is created, set its status to Draft.
Step 5: Add Constraints
Add these constraints to the prompt to keep the AI Action efficient, accurate, and consume fewer credits.
## Constraints:
- Do not look up the campaign separately - use the campaign ID already on the post.
- Do not look up the tags separately - use the Tags from the post.
- Do not browse existing stories on the board.
- Do not re-fetch or verify data you already received from a previous step.
- Fetch all tags in a single request with a large page size — do not paginate.
Step 6: Permissions and Model
- Permissions: Read + Write
- Model: Fast
Step 7: Activate and Test
- Save the Flow.
- Run a test with a sample post that matches your filter conditions.
- Open the target board and confirm a new Draft Story appears.
- Check the title, description, media, tags, topic, and the three message ideas.
Testing Note
Test posts with different types, including PDF, Video, Hyperlink, Images, no Images, mentions, hashtags, and complex text like a product specification.