Yes, you can do this in n8n and it can be done without using any sort of storage either. You can use “Workflow Static Data” to preserve the data between executions of the workflow. Use a normal Schedule Trigger, then add a code node with the following code:
const staticData = $getWorkflowStaticData('global'); const startDate = staticData.lastEndDate ?? '2024-01-12'; const endDate = new Date().toISOString(); // persist for next run staticData.lastEndDate = endDate; return [{ startDate, endDate }];
Complete your logic and use “startDate” and “endDate” for the rest of your workflow. Just to be safe you might want to add another Code node at the end to update the “lastEndDate”. This should help and accomplish what you are looking for.