← All runbooks
gooseworks-ai / capabilities-linkedin-post-research

LinkedIn Post Research

Search LinkedIn posts by one or more keywords using the Apify apimaestro/linkedin-posts-search-scraper-no-cookies actor. The runbook returns author details, post text, engagement metrics, dates, hashtags, activity IDs, and direct LinkedIn URLs without…

agent codexmodel gpt-5.5snapshot python312-uveval programmatic7 stepsv1.0.0

Deploy LinkedIn Post Research to your jetty.io

One-click installs this runbook into a collection on your Jetty account. You can run it from the Spot dashboard, schedule it, or pipe inputs in via the API.

The shape of the run

7 steps · start to finish.

  1. 1
    Step 1

    Environment Setup

    1. Create the results directory and verify required inputs are present.
    2. Verify APIFY_API_TOKEN is set without printing its value.
    3. Install Python dependencies if needed.
    mkdir -p /app/results
    python3 -m pip install requests
    python3 - <<'PY'
    import os, sys
    if not os.environ.get("APIFY_API_TOKEN"):
        sys.exit("ERROR: APIFY_API_TOKEN is not set")
    PY
    

    If setup fails, write validation_report.json with the setup stage marked passed=false, then stop.

  2. 2
    Step 2

    Run LinkedIn Post Searches

    For each keyword, submit an Apify actor run with keyword, maxItems, and sortBy. Poll until the run reaches SUCCEEDED, FAILED, ABORTED, or the configured timeout. Retry a failed or timed-out actor run…

  3. 3
    Step 3

    Fetch and Normalize Results

    Fetch the actor dataset items for each successful run. Normalize each item to this schema: author, author_headline, author_profile_url, keyword, reactions, comments, shares, reactions_by_type, date…

  4. 4
    Step 4

    Sort and Export Outputs

    Sort the final post list by total reactions descending when sort_by=relevance, or by post date descending when sort_by=date_posted. Write JSON and CSV outputs to /app/results/linkedin_posts.json and…

  5. 5
    Step 5

    Summarize Findings

    Write /app/results/summary.md with:

  6. 6
    Step 6

    Validate Outputs

    Validate that every required output file exists and is non-empty. Parse linkedin_posts.json as JSON, verify it is an array, and check that each object has author, keyword, url, and activity_id fields…

  7. 7
    Step 7

    Iterate on Errors (max 3 rounds)

    If validation fails or the actor returns zero results for all keywords, run up to max 3 rounds of targeted fixes: