What is n8n? Definition: n8n (notion) is a free and open-source workflow automation tool. Key Feature: It allows you to connect APIs, services, and devices with custom logic to automate tasks. "Fair-code" license: Source available, but with some restrictions on commercial use by large companies. Self-hosted or Cloud: Can run locally, on a server, or use n8n Cloud. Core Concepts Workflow: A sequence of nodes connected together, defining an automated process. Node: A block that performs a specific action (e.g., make an HTTP request, process data, send an email). Trigger Node: The first node in a workflow that starts its execution (e.g., Webhook, Cron, Database change). Execution: A single run of a workflow. Items: Data units that flow through the workflow. Each item is typically a JSON object. Credentials: Securely stored authentication details (API keys, OAuth tokens) for connecting to external services. Workflow Building Blocks Trigger Nodes Webhook: Starts workflow on an incoming HTTP request (POST, GET, PUT, etc.). Useful for web services, IoT. Cron: Schedules workflow execution at specific intervals (e.g., every hour, daily at 3 PM). Manual: Starts workflow on demand from the UI. Specific Service Triggers: e.g., "New Email in Gmail", "New Row in Google Sheets". Action Nodes (Common Examples) HTTP Request: Make custom API calls to any service. Essential for integrating custom backends. Set: Add, modify, or remove fields from items. Merge: Combine items from different branches of a workflow. Split In Batches: Process items in smaller groups. Code: Execute custom JavaScript code to transform data or implement complex logic. Access data: $json.fieldName , $item.json.fieldName Return data: return items; IF: Conditionally route workflow execution based on data. Loop: Iterate over arrays of items (e.g., Split In Batches, Item Lists). Wait: Pause workflow execution for a specified duration. NoOp: A "no operation" node, useful for debugging or temporarily disabling a branch. Error Trigger/Catch: Handle errors gracefully within workflows. Data Manipulation: Remove & Keep: Selectively remove or keep fields. Sort: Order items based on a field. Deduplicate: Remove duplicate items. Data Handling & Expressions JSON Format: All data within n8n workflows is handled as JSON. Expressions: Used to dynamically access and manipulate data. Referencing current item data: {{ $json.myField }} Referencing data from a previous node (e.g., "HTTP Request"): {{ $('HTTP Request').item.json.data }} Referencing parameters: {{ $parameter.myParam }} Accessing arrays: {{ $json.myArray[0].item }} Built-in functions: {{ $json.date.toDate().plus({ days: 1 }).toFormat('yyyy-MM-dd') }} Context variables: {{ $workflow.id }} , {{ $execution.id }} `$json` vs `$item`: $json refers to the JSON data of the current item. $item refers to the entire item object (which contains $item.json and $item.binary ). Debugging & Monitoring Execution Log: View past workflow executions, including input/output of each node. Test Workflow: Run a workflow manually to see data flow and debug in real-time. Stop & Debug: Add a "Stop" node to pause execution at a certain point and inspect data. `console.log()` in Code Nodes: Output messages to the execution log. Use Cases for STEM Students Data Collection & Processing: Scrape data from websites, APIs, or documents. Automate data cleaning, transformation, and aggregation. Ingest data into databases (SQL, NoSQL) or spreadsheets. API Integration: Connect scientific tools, cloud services, or custom APIs. Automate data transfer between different platforms. Research Automation: Schedule data fetching from public datasets. Automate report generation. Trigger analyses based on new data availability. IoT & Sensor Data: Receive data from IoT devices via webhooks. Process sensor readings and trigger alerts or actions. Coursework & Projects: Build custom integrations for project components. Automate repetitive tasks in assignments (e.g., submitting data, processing results). Best Practices Modular Workflows: Break down complex tasks into smaller, manageable workflows. Error Handling: Implement error triggers and catches to make workflows robust. Clear Naming: Give descriptive names to nodes and workflow variables. Comments: Use the "Note" node to add explanations to complex parts of your workflow. Version Control: Export workflows as JSON and manage them with Git. Security: Be mindful of sensitive data and API keys; use n8n's credential management.