How to Build an Automated Monthly Social Performance Report Agent

Build a Custom Agent that pulls performance data from your Social BI dashboard on a set schedule and emails a formatted monthly summary, with no manual reporting required. This example uses specific LinkedIn and Instagram profiles, but you can adapt the same approach and prompt for whichever networks and profiles you want to report on.

On a fixed schedule, the agent reads performance widgets from a Social BI dashboard, an AI Action node analyzes and summarizes them into named fields, and an Email node sends those fields into a pre-formatted report.

What you'll build

Schedule → AI Action → Email

Three nodes total.

Prerequisites

  • An Oktopost Social BI dashboard already built with the widgets you want to report on. In this example: Posts, Impressions, Engagements, and Engagement Rate for specific LinkedIn and Instagram profiles, plus a Top Performing Posts widget. Building the dashboard first, rather than having the agent query raw analytics directly, is best practice. It lets you configure exactly which network profiles each widget reports on, which matters if you have many profiles connected, and lets you set the specific metrics each widget returns. This keeps the agent focused only on the profiles and data you want reported on, which also reduces AI credit consumption, since the agent is not spending calls analyzing irrelevant profiles or data.
  • The dashboard ID and each widget's report ID. You will find these by opening the dashboard and each report at the end of the URL.
  • Access to the Custom Agent builder
  • Read-only access is sufficient, as this agent never writes anything back to Oktopost

Step 1: Create the agent

  1. From the main Oktopost dashboard, open Custom Agents from the left sidebar.
  2. Click + New and give the agent a descriptive name (for example, "Social BI Monthly Report").
  3. Build the flow as three connected nodes on the canvas: ScheduleAI ActionEmail.

Step 2: Add the Schedule node

This is the trigger. It decides when the report runs.

  1. Click + on the canvas and select Schedule.
  2. Set the frequency to match your reporting cadence. For a monthly report, choose the day, week, or month pattern that fits when you want it sent (for example, the 1st Monday of the month at 12:45).
Because the report always looks at the most recently completed full calendar month (see the prompt in Step 3), schedule this for early in the following month, once the previous month's data has fully settled in the dashboard.

Step 3: Add the AI Action node

This node does all the analysis. Connect it after the Schedule node.

3a. Paste the Instructions

Use the prompt below as a starting point. It tells the agent exactly which widgets to pull, how to compare against benchmarks, and what shape to output the results in. Review it carefully and edit it to match your own requirements before pasting it into the node's Instructions field. Do not use it as-is without checking whether it fits your use case.

You are an automated social media analyst agent. Your task is to process LinkedIn and Instagram channel data from the Oktopost Social BI "Engagement" dashboard ID: [INSERT_DASHBOARD_ID] for the most recently completed full calendar month, using get_dashboard_report_data. Disregard day-of-week charts and time-of-day matrices.

Retrieve the following eight widgets once each. Each returns both the current and prior period automatically via the Current (this period) and Prev (the immediately preceding period) fields — use these directly for the current vs. previous-month comparison, and do not attempt to pass additional network or date-range filters to this tool. If a widget's Prev value is missing or null, state that explicitly in the relevant section rather than estimating it.

LinkedIn:

Posts: report ID [INSERT REPORT_ID]
Impressions: report ID [INSERT REPORT_ID]
Engagements: report ID [INSERT REPORT_ID]
Engagement Rate: report ID [INSERT REPORT_ID]

Instagram:

Posts: report ID [INSERT REPORT_ID]
Impressions: report ID [INSERT REPORT_ID]
Engagements: report ID [INSERT REPORT_ID]
Engagement Rate: report ID [INSERT REPORT_ID]

To identify the single highest-engagement post across both networks, call get_dashboard_report_data using report ID [INSERT REPORT_ID] (the "Top Performing Posts" widget), which returns individual post records from both the specified LinkedIn and Instagram profiles combined, with Engagements and Engagement Rate only — no other fields are available and none should be requested or referenced. From the returned rows, identify the one with the highest Engagement value yourself, regardless of which network it belongs to; the widget does not pre-rank results. Use only that post's Engagements and Engagement Rate figures. Do not include the post's message text, copy, network, or other identifying content in the summary — refer to it only as "the top-performing post" or equivalent. This step is independent of the headline metrics above — if this call fails or returns no data, complete the headline metrics sections regardless and state the top-post gap explicitly rather than omitting the section.

DATA INPUTS — for each network separately, extract: # Posts, Impressions, Engagements, Engagement Rate (ER) for the reporting month and the previous month. For LinkedIn only, compare ER against the internal 10% target, the 6% B2B LinkedIn Institute average, and Column's 3.6% B2B Tech/SaaS baseline. For Instagram, compare ER against the internal 10% target only — the 6% and 3.6% external benchmarks are LinkedIn-specific and do not apply. Separately, identify the single highest-engagement post across both networks and its Engagements and Engagement Rate only.

TASK 1 — Write five short, separate sections, one per field (LIHEADLINE, LIBENCHMARKS, IGHEADLINE, IGBENCHMARKS, TOPPOST). Each section is flowing prose (no bullets), 40–70 words, and must stand alone as a complete thought — do not reference "as mentioned above" or rely on other sections for context, and do not compare the two networks against each other within any section. LIHEADLINE and IGHEADLINE cover that network's performance verdict with exact totals and variance vs. previous month and the 10% target. LIBENCHMARKS covers LinkedIn's ER vs. the 6% and 3.6% baselines and whether volume or creative is driving competitiveness. IGBENCHMARKS covers Instagram's ER vs. the 10% target only, using the same volume-vs-creative framing. TOPPOST covers the single top-performing post's Engagements and Engagement Rate only, including the null-prior-period caveat if it occurs — no message text, network, or content description. No speculative or placeholder language in any section — state only what the data confirms.

TASK 1B — Write one additional field, COMBINEDSUMMARY, a single standalone sentence (25–40 words) giving the combined LinkedIn + Instagram totals for the reporting month, with the combined previous-month totals shown in brackets immediately after. Calculate both from the same underlying Posts, Impressions, and Engagements Current/Prev totals already retrieved for the LIHEADLINE/IGHEADLINE sections above — do not estimate. Use this exact structure:

"Combined, LinkedIn and Instagram posted {total_posts} times this month, generating {total_impressions} impressions and {total_engagements} engagements, for a blended engagement rate of {blended_engagement_rate}% (previous month: {prev_total_posts} posts, {prev_total_impressions} impressions, {prev_total_engagements} engagements, {prev_blended_engagement_rate}% blended engagement rate)."

Where:
total_posts = LinkedIn Posts (Current) + Instagram Posts (Current)
total_impressions = LinkedIn Impressions (Current) + Instagram Impressions (Current)
total_engagements = LinkedIn Engagements (Current) + Instagram Engagements (Current)
blended_engagement_rate = (total_engagements / total_impressions) × 100, rounded to 1 decimal place
prev_total_posts = LinkedIn Posts (Prev) + Instagram Posts (Prev)
prev_total_impressions = LinkedIn Impressions (Prev) + Instagram Impressions (Prev)
prev_total_engagements = LinkedIn Engagements (Prev) + Instagram Engagements (Prev)
prev_blended_engagement_rate = (prev_total_engagements / prev_total_impressions) × 100, rounded to 1 decimal place

Do not include benchmark comparisons or target variance in this field — totals and the current-vs-previous comparison only.

TASK 2 — Provide exactly 3 recommendations, one per field (ACTION1, ACTION2, ACTION3), covering both networks across the three (at least one recommendation should reference LinkedIn and at least one should reference Instagram, using data from that specific network). Each field must contain a single standalone recommendation only — no analysis, no restated metrics, no additional commentary, and no leading number or label of any kind (the email template numbers these automatically). Each recommendation follows: [action verb] + [content format/tactic] + [data-grounded optimization] + [channel] + [objective], citing one specific data point, benchmark gap, or top-post metric from that network. No generic filler.

Output only the six summary sections (COMBINEDSUMMARY, LIHEADLINE, LIBENCHMARKS, IGHEADLINE, IGBENCHMARKS, TOPPOST) and the three numbered actions (ACTION1, ACTION2, ACTION3) — no headers or meta-commentary within any field.
Replace [INSERT_DASHBOARD_ID] and each [INSERT REPORT_ID] with your own dashboard and widget IDs. Open the dashboard and each report in your browser and take the ID from the end of the URL. For example, a dashboard ID looks like dshmquylbeke70q and a report ID looks like wgtmrnx1yjiple2.
The benchmark comparisons in the prompt (the internal 10% target, the 6% B2B LinkedIn Institute average, and Column's 3.6% B2B Tech/SaaS baseline) may not be relevant to your requirements. Only include them if your use case involves internal targets or industry benchmark comparisons. Otherwise remove or adapt them. If you keep them, update the figures to match your own targets and benchmarks. This benchmark language appears in two places in the prompt: the DATA INPUTS paragraph and the TASK 1 paragraph. If you edit or remove it, keep both spots consistent.

3b. Set the node configuration

Setting Value Why
Permissions Read only This node only reads dashboard data. It never creates or modifies anything in Oktopost, so it does not need write access.
Model Thinking This task involves multi-step comparison and arithmetic (benchmark comparisons, blended-rate calculations) across eight data pulls, so the Thinking model is more reliable than Fast.
Enable Web Search Off Not needed, as all data this agent uses comes from the dashboard widgets, not the web.

3c. Add the Response Fields

Under AdvancedResponse Fields, add each of the following as type String. This forces the agent to return clean, individually addressable fields instead of one block of free text, which lets the Email node in Step 4 pull each piece into its own spot in the template.

Field Type
ACTION1 String
ACTION2 String
ACTION3 String
LIHEADLINE String
LIBENCHMARKS String
TOPPOST String
IGHEADLINE String
IGBENCHMARKS String
COMBINEDSUMMARY String

Step 4: Add the Email node

Connect this after the AI Action node. It is the final step that sends the finished report.

  1. Set To to the recipient's email address.
  2. Set CC / BCC if needed, or leave blank.
  3. Set Subject to a descriptive subject line for the report.
  4. In Content, build the email body with static text and headings, and insert each AI field using the variable picker. Click into the content area, open the picker, and select each field from the AI Action node's output. It inserts as {{nodes.<node-id>.output.response.FIELDNAME}}.

You can paste the template below into the email body, then replace each placeholder with the matching field from the variable picker.

Hi,

Here's the monthly social performance summary, pulled from the Oktopost Social BI Engagement dashboard.

Performance Overview
{{...output.response.COMBINEDSUMMARY}}

LinkedIn: {{...output.response.LIHEADLINE}}
{{...output.response.LIBENCHMARKS}}

Instagram: {{...output.response.IGHEADLINE}}
{{...output.response.IGBENCHMARKS}}

Top Performing Post
{{...output.response.TOPPOST}}

Recommended Next Steps
{{...output.response.ACTION1}}
{{...output.response.ACTION2}}
{{...output.response.ACTION3}}

Oktopost Reporting Agent

Step 5: Test and review

  1. To test before relying on the live schedule, set the Schedule node to run in the next 5–10 minutes, rather than waiting for the actual monthly trigger date.
  2. Check that all nine fields appear correctly in the sent email and there are no empty fields or unresolved {{...}} placeholders.
  3. Confirm the numbers in COMBINEDSUMMARY match what you expect from adding the individual channel totals together. This is a good sanity check that the AI node correctly retrieved and summed the underlying widget data. Confirm the report covers the profiles and metrics you want reported on.
  4. Once you have confirmed everything looks correct, set the Schedule node back to your intended recurring cadence.

Troubleshooting

A field shows up blank in the email

Check that the Response Field name in the AI Action node exactly matches the field name selected via the variable picker in the Email node. A mismatch resolves to nothing.

The report seems to be using the wrong month's data

The prompt relies on the dashboard widgets automatically returning current and prior period data based on when the agent runs. Confirm the Schedule node fires after the reporting month has fully closed, not partway through it.

One network's numbers look off

If a widget's Prev value is null (for example, a newly added profile with no history yet), the agent is instructed to state that explicitly rather than guess. Check the relevant section's wording if a comparison seems to be missing.

Was this article helpful?
0 out of 0 found this helpful