API endpoints
Reference
Building queries
Integrations
Example 2: News Alert System Workflow
This workflow monitors Event Registry for recent events and sends formatted alerts using the minuteStreamEvents endpoint. Runs automatically every 5 minutes to provide near real-time monitoring. The endpoint tracks both new events and updates to existing events, making it ideal for real-time activity tracking.
Workflow Steps
- Schedule Trigger - Runs every 5 minutes
- HTTP Request - Fetches recent events from Event Registry using minuteStreamEvents endpoint
- IF - Checks if events were returned
- Set - Converts
eventInfoobject to array - Split Out - Processes each event individually
- Edit Fields - Extracts and formats event data
- HTML - Formats alert as HTML (optional)
- Email - Sends notification
Step-by-Step Node Configuration
1. Schedule Trigger Node
- Add a Schedule Trigger node from the trigger nodes
- Configure the following:
- Trigger Times: Select
Every MinuteorCustom Cron - For
Every Minute: Set Every X Minutes: to5 - For
Custom Cron: Enter*/5 * * * *(runs every 5 minutes) - Click "Back to canvas" in the upper left corner
2. HTTP Request Node
- Add an HTTP Request node after the Schedule Trigger
- Configure the following settings:
- Method: Select
POSTfrom the dropdown - URL: Enter
https://eventregistry.org/api/v1/minuteStreamEvents - Authentication: Select
Generic Credential Type - Credential Type: Select
Custom Auth - Credential for Custom Auth: Select your
Event Registry APIcredential - Send Body: Check the box
- Body Content Type: Select
JSON - Specify Body: Specify body using JSON
- Body: Enter the following request body JSON:
- Note: For detailed filtering options and available parameters, see the Stream of events endpoint documentation (keywords, categories, locations, language, etc.).
- Click "Back to canvas" in the upper left corner
3. IF Node
- Add an IF node after the HTTP Request node
- Configure the condition to check if events were returned:
- Condition: Select
Number - Value 1: Enter expression
{{ $json.recentActivityEvents?.events?.length || 0 }} - Operation: Select
is greater than - Value 2: Enter
0 - Note: The API returns events in
recentActivityEvents.eventInfoobject (URI → event mapping). This condition ensures the workflow only continues if events exist. - Click "Back to canvas" in the upper left corner
4. Edit Fields Node
- Connect into the
trueoutput of the IF node - Click Add Value and configure the following:
- Field Name:
eventsArray, Value:{{ Object.values($json.recentActivityEvents.eventInfo || {}) }} - Click "Back to canvas" in the upper left corner
5. Split Out Node
- Add a Split Out node after the Set node
- Configure the following:
- Fields to Split Out: Enter
eventsArray - Include: Select
All Other Fieldsto keep the original response data - Note: The
recentActivityEvents.eventsarray contains URIs of new events. You can distinguish between NEW and UPDATED events by checking if an event URI exists in this array (see Edit Fields node below). - Click "Back to canvas" in the upper left corner
6. Edit Fields Node
- Add an Edit Fields node after the Split Out node
- Click Add Value for each field you want to extract:
- Field Name:
title, Value:{{ !!$json?.title?.eng ? $json.title.eng : Object.values($json.title)[0] }} - Field Name:
summary, Value:{{ $json.summary?.eng || $json.summary || 'No summary available' }} - Field Name:
articleCount, Value:{{ $json.totalArticleCount || $json.articleCounts?.total || 0 }} - Field Name:
alertLevel, Value:{{ ($json.totalArticleCount || $json.articleCounts?.total || 0) > 200 ? 'CRITICAL' : (($json.totalArticleCount || $json.articleCounts?.total || 0) > 50 ? 'HIGH' : 'MEDIUM') }} - Field Name:
eventUri, Value:{{ $json.uri || '' }} - Click "Back to canvas" in the upper left corner
7. HTML Node
- Add an HTML node after the Split Out node
- Configure the following:
- Operation: Select
Convert to HTML Table - Click "Back to canvas" in the upper left corner
8. Email Node
- Add a Gmail or Email node after the HTML node
- Configure based on your chosen node type:
- For Gmail node:
- Operation: Select
Send - To: Enter recipient email address
- Subject: Enter email subject, e.g.,
Content Research Results - Email Type: Select
HTML - Message: Use expression
{{ $json.table }}to reference HTML Table from previous node
- Operation: Select
- For Email node:
- If you haven't already, configure your email account credentials first
- Operation: Select
Send - To Email: Enter recipient email address
- Subject: Enter email subject, e.g.,
Content Research Results - Email Format: Select
HTML - Message: Use expression
{{ $json.table }}to reference HTML Table from previous node
- For Gmail node:
- Click "Back to canvas" in the upper left corner
Additional Resources
- For Schedule Trigger configuration, see n8n Schedule Trigger documentation
- For notification setup, see Email Node or Slack Node documentation
- For Set node usage, see Set Node documentation