Scheduled Data Creation and Transformation - n8n Workflow

Use this foundational n8n workflow template to understand core logic, utilizing the Interval n8n trigger, Function n8n node, and Set n8n node for scheduled data generation and transformation.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

New users eager to understand the basics of building an n8n workflow.
Developers needing a scheduled base structure for periodic tasks.
Users looking for practical examples of the Function and Set n8n node functionality.
Anyone interested in mastering data manipulation within n8n templates.

Overview

This fundamental n8n workflow serves as an excellent starting point for learning data flow and control. It addresses the need for periodic execution of simple logic tasks. The workflow demonstrates how to schedule an operation using the powerful Interval n8n trigger, inject custom data using the Function n8n node, and refine the resulting data structure using the Set n8n node. By analyzing this n8n workflow, users gain valuable insights into how data items flow between different n8n node types, making it an indispensable example among n8n templates for core logic.

How it Works

The logic of this n8n workflow is straightforward and focuses on data handling:


  1. Scheduled Execution (2 hours Interval n8n trigger): The process begins with the Interval n8n trigger, which is configured to execute the entire n8n workflow every two hours.

  2. Custom Data Injection (FunctionItem n8n node): Upon activation, the data passes to the FunctionItem n8n node. This custom code node adds two new key-value pairs (myVariable and myVariable2) to the incoming data item, demonstrating basic data enrichment.

  3. Data Extraction and Filtering (Set n8n node): Finally, the data moves to the Set n8n node. This n8n node extracts the value of myVariable2 (which contains the string 'this is exciting') from the output of the previous FunctionItem n8n node. It sets this value to a new property named data and uses the 'Keep Only Set' configuration to ensure only this newly created data property is passed to the next stage of the n8n workflow, effectively cleaning the data item.

Installation Guide

To deploy this n8n workflow template, follow these steps:


  1. Import the JSON: Copy the provided n8n workflow JSON code.

  2. Navigate to n8n: Open your self-hosted or cloud n8n instance.

  3. Create New Workflow: Click 'New' or 'Import from JSON' and paste the copied JSON content.

  4. Review Nodes: Examine the configuration of each n8n node, specifically the '2 hours Interval' n8n trigger and the FunctionItem n8n node to understand the data logic.

  5. Activate: Save the n8n workflow and toggle the 'Active' switch to enable the scheduled 2-hour execution. Since this n8n workflow does not rely on external credentials, activation is immediate.

Node Details

This n8n workflow utilizes three essential core nodes:

2 hours Interval (n8n trigger)
Function: Acts as the starting n8n trigger for the n8n workflow, executing the automation on a fixed time basis.
Key Configuration: Set to execute every 2 hours (unit: hours, interval: 2).

FunctionItem (n8n node)
Function: Executes JavaScript code to modify the data item. It injects custom variables for downstream use.
Key Configuration: Defines item.myVariable = 1; and item.myVariable2 = "this is exciting"; to enrich the data payload.

Set (n8n node)
Function: Transforms and filters the data structure. It selectively passes data from previous n8n nodes.
* Key Configuration: Sets a new property named data using an expression ={{$node["FunctionItem"].data["myVariable2"]}}. Crucially, keepOnlySet is enabled, ensuring only the new data property remains in the output item.

Related n8n Workflows

Free

Nodes: 3 Nodes
Updated: December 26 2025
View all
Created by
sven
sven

Featured*