Quick Overview
This workflow runs daily on a schedule, queries CourtListener for new opinions matching topics and courts defined in a WordPress plugin, drafts neutral case summaries with OpenAI, and publishes new posts to the WordPress site while producing a run summary of created, duplicate, and failed ingests.
How it works
- Runs every day at 7 AM on a scheduled trigger.
- Pulls Case Monitor settings from a WordPress site via the CLCM plugin API and builds a CourtListener search query from the configured topics, courts, and lookback window.
- Calls the CourtListener Search API for recent opinions, then normalizes the results into a consistent set of fields (title, URL, court, date, and snippet).
- Sends the opinion URLs to the WordPress CLCM plugin to identify which decisions are already known, and keeps only the newly discovered decisions.
- Uses OpenAI (GPT-4o-mini) to generate a structured JSON draft containing a headline, HTML body, excerpt, and tags for each new decision, and discards drafts that are not valid JSON or missing required fields.
- Submits each valid draft to the WordPress CLCM ingest endpoint to create a post, then compiles a final summary with counts and created post metadata.
Setup
- Install and configure the WordPress CLCM plugin on your site so the /wp-json/clcm/v1/config, /check, and /ingest endpoints are available and you have a valid X-CLCM-Key.
- Update the site URL and CLCM API key values in the workflow’s site configuration step to match your WordPress environment.
- Provide a CourtListener API token and replace the Authorization header used for the CourtListener Search API request.
- Add an OpenAI API credential and ensure the selected chat model (gpt-4o-mini) is available in your account.
- Adjust the schedule time and the WordPress plugin settings (topics, courts, and days_lookback) to control which decisions are monitored and posted.