API endpoints
Reference
Building queries
Integrations
Example 3: Sentiment Analysis Workflow
This workflow retrieves articles from Event Registry API, processes them with sentiment data, and appends results to a Google Sheet for sentiment analysis purposes.
Workflow Steps
- Schedule Trigger - Runs at regular intervals (hourly, daily, etc.)
- HTTP Request - Fetches articles with sentiment data
- Split Out - Separates articles into individual items
- Edit Fields - Transforms article data for spreadsheet
- Google Sheets - Appends data to spreadsheet
Step-by-Step Node Configuration
1. Schedule Trigger Node
- Add a Schedule Trigger node from the trigger nodes
- Configure the following:
- Trigger Times: Select your preferred schedule (e.g.,
Every Hour,Every Day, orCustom Cron) - For
Custom Cron: Enter cron expression (e.g.,0 * * * *for hourly,0 0 * * *for daily) - 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/article/getArticles - 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:
- Important: Set
includeArticleSentiment: trueto retrieve sentiment scores for each article - Click "Back to canvas" in the upper left corner
3. Split Out Node
- Add a Split Out node after the HTTP Request node
- Configure the following:
- Fields to Split Out: Enter
articles.results - Include: Select
No Other Fieldsfrom the dropdown - This separates each article into its own item for processing
- Click "Back to canvas" in the upper left corner
4. Edit Fields Node
- Add an Edit Fields node after the Split Out node
- Click Add Value for each field you want to map to spreadsheet columns:
- Field Name:
title, Value:{{ $json.title }} - Field Name:
date, Value:{{ $json.date }} - Field Name:
source, Value:{{ $json.source.title }} - Field Name:
url, Value:{{ $json.url }} - Field Name:
sentiment, Value:{{ $json.sentiment }} - Field Name:
body, Value:{{ $json.body }} - Note: Ensure field names match your Google Sheet column headers exactly
- Click "Back to canvas" in the upper left corner
5. Google Sheets Node
- Add a Google Sheets node after the Edit Fields node
- Configure your Google Sheets credentials first (if not already done):
- Go to Credentials → Add credential → Google
- Follow the OAuth flow to connect your Google account
- Back in the Google Sheets node, configure:
- Operation: Select
Appendfrom the dropdown - Credential: Select your Google Sheets credential
- Document: Click Select and choose your Google Sheet from the list
- Sheet Name: Select the specific sheet/tab from the dropdown
- Data Mode: Select
Map Each Column Manually - For each column in your sheet, click Add Column:
- Column: Select the column name (e.g.,
Title,Date,Source) - Value: Enter the corresponding field from Edit Fields (e.g.,
{{ $json.title }},{{ $json.date }}) - Repeat for all columns (Title, Date, Source, URL, Sentiment, Body)
- Click "Back to canvas" in the upper left corner
Customization Ideas
- Adjust article count: Modify
articlesCount(max 50 per request) - Filter by keyword: Change the
keywordparameter - Filter by date: Add
dateStartanddateEndparameters - Filter by source: Add
sourceUriparameter - Prevent duplicates: Add logic to check for existing articles before appending (use article URL or ID as unique identifier)
Additional Resources
- For Google Sheets node setup, see Google Sheets Node documentation
- For Schedule Trigger configuration, see n8n Schedule Trigger documentation