See llms.txt for all machine-readable content.

Back to Templates

Screen clients for adverse media and PEPs with GDELT, Wikidata and OpenAI

Quick overview

Screens clients for PEP exposure and adverse media before onboarding and every month. GDELT news and Wikidata PEP data are checked, OpenAI judges article relevance, fixed rules set the risk rating, a reviewer decides, HIGH needs a second approver, and every case is logged for audit.

How it works

  1. A client arrives through a Header Auth webhook, an n8n form or the monthly re-screen of your client list; the request is validated, open cases are reused and a case is opened in a Data Table.
  2. GDELT is searched for the name and aliases with negative-news terms based on FATF predicate offences (fraud, corruption, money laundering, sanctions, convictions and more) over the last 3 months, with retries that respect GDELT's rate limit.
  3. Wikidata is queried for PEP positions, PEP relatives, convictions and state ownership; date of birth and country set namesakes aside, and positions are marked domestic or foreign.
  4. Articles are deduplicated, ranked and read; OpenAI decides for each one whether it is about the client, with category, stage and confidence.
  5. Deterministic rules, not the AI, turn the facts into flags and a LOW, MEDIUM or HIGH rating. A case where a source did not answer is never auto-cleared.
  6. Clean results close automatically; everything else is e-mailed to a reviewer who clears, confirms or escalates in an n8n form. Clearing a HIGH rating needs a second approver (four-eyes).
  7. The final case record, with sources, queries, model, prompt and rule versions, is written to the audit log, and the requester and compliance officer are notified.

Setup

  1. Run the "Run once to set up" node to create the adverse_media_cases and adverse_media_clients Data Tables.
  2. Connect an OpenAI API credential and a Gmail OAuth2 credential.
  3. Create a Header Auth credential (for example the header X-Screening-Key with a long random value) and select it on the webhook and on both nodes that send to it; add Basic Auth on the form.
  4. In "Screening settings", replace the REPLACE_WITH_... reviewer, second approver and compliance officer e-mails and set home_country; in "Webhook settings", set this workflow's production webhook URL; set your ops address in "Alert compliance ops".
  5. Set this workflow as its own error workflow, activate it, and test it with a known PEP, a namesake with another date of birth and an unknown name.

Requirements

  • A current n8n version with Data Tables (cloud or self-hosted).
  • An OpenAI API key, gpt-4.1-mini by default. The model is called only when articles were found.
  • A Gmail account. You can swap in Outlook, Slack or Teams for the notifications.
  • No other keys: Wikidata SPARQL and GDELT DOC 2.0 are free public APIs.

Customization

  • PEP position classes: PEP_CLASSES and LOCAL_CLASSES in Build Wikidata PEP query; include_local_pep and former_pep_months in Screening settings.
  • News taxonomy and search words: TAXONOMY and GDELT_TERMS in Build news queries; news_lookback, gdelt_source_language, google_news_mode and max_articles in Screening settings.
  • Rating rules: SEVERITY, STAGE and RULE_VERSION in Apply risk rules; min_match_confidence, auto_close_clean_results and four_eyes_on_high in Screening settings.
  • Name matching: MIN_NAME_SCORE and STRONG_NAME_SCORE in Match PEP candidates.
  • Reuse and open-case windows: REUSE_DAYS and OPEN_CASE_DAYS in Check open cases and reuse window.
  • Model: replace OpenAI with Anthropic, Gemini or a self-hosted model through Ollama, and raise prompt_version when you change the prompt.

Additional info

Limitations: Wikidata only knows PEPs someone has entered, so local, regional and many foreign PEPs, their relatives and close associates are often absent, and mandate end dates are often missing. GDELT covers about the last 3 months of online news in its own index and can be slow or rate-limited (1 request every 5 seconds); its data is free to use with attribution to the GDELT Project. A news search with no result is treated as clean; set auto_close_clean_results to false if every case must be reviewed by a person. Google News RSS is off by default because its terms allow personal, non-commercial use only. No sanctions lists are checked; OpenSanctions is not used because its data needs a commercial licence for business use. Client names and article excerpts are sent to the AI provider you connect. Reviewers type their name and e-mail into the decision form, which the four-eyes check relies on; it is not tied to an n8n login. This is a first-pass aid and an audit trail, not a substitute for a licensed screening provider, and it does not by itself make you compliant with AML, KYC or PEP rules; the reviewer makes the final decision.