Skip to main content

Last Updated Actions

Last Updated actions keep a watermark against a key, so an incremental poll can resume where the last one stopped instead of re-reading everything. This is the operation behind the Temporal Pattern.

In n8n they live under the Last Updated resource.

Available Operations

Last Updated Actions

  • Add - Write the watermark for a key, creating it or replacing the stored date
  • Get - Read the watermark for a key

Get

Read the watermark for a key.

Get Configuration

ParameterTypeRequiredDescription
KeyStringYesUnique identifier for the last updated record. Must contain only letters, numbers, hyphens, and underscores. Maximum 255 characters.

Under Additional Fields:

ParameterTypeRequiredDescription
Date FormatOptionsNoThe format to use for the date. Defaults to ISO 8601 with Timezone.
Custom FormatStringNoProvide the date format using tokens like yyyy, MM, dd, HH, mm, ss. Used when Date Format is Custom Format.
Use UTC TimezoneBooleanNoWhether to convert the date to UTC timezone instead of using n8n's server timezone. Defaults to false.
Fallback DateStringNoThe fallback date value to use when no last updated record exists. Must be in the same format as the Date Format field.

Date Format offers: ISO 8601 with Timezone, ISO 8601 UTC, dd-MM-yyyy, MM-dd-yyyy, yyyy-MM-dd, dd/MM/yyyy, MM/dd/yyyy, yyyy/MM/dd, Unix Timestamp - Milliseconds, Unix Timestamp - Seconds, Custom Format.

Get Response

{
"id": "clu123456789",
"key": "shopify-orders",
"description": "Last successful order poll",
"date": "2024-01-01T10:00:00.000+00:00",
"createdAt": "2024-01-01T10:00:00.000Z",
"updatedAt": "2024-01-01T10:00:00.000Z"
}

date is rendered in the chosen Date Format; createdAt and updatedAt are the server's own ISO timestamps.

When no record exists for the key the node returns the fallback instead, formatted the same way:

{ "date": "2024-01-01T00:00:00.000+00:00" }

and with no Fallback Date set:

{ "date": null }

Branch on date being null to tell a first run from a resumed one.

Add

Write the watermark for a key. If the key already exists its date is replaced in place, so a failed write can never leave the key without a watermark.

Add Configuration

ParameterTypeRequiredDescription
KeyStringYesUnique identifier for the last updated record. Must contain only letters, numbers, hyphens, and underscores. Maximum 255 characters.

Under Additional Fields:

ParameterTypeRequiredDescription
DescriptionStringNoOptional human-readable description explaining the purpose of this Last Updated record.
DateStringNoThe date to record, written in the format chosen in the Date Format field. Leave empty to use the current time.
Date FormatOptionsNoThe format of the input date string. Defaults to ISO 8601 with Timezone.
Custom FormatStringNoProvide the expected format using tokens like yyyy, MM, dd, HH, mm, ss. Used when Date Format is Custom Format.

Date Format offers the same list as Get.

Add Response

{
"id": "clu123456789",
"key": "shopify-orders",
"description": "Last successful order poll",
"date": "2024-01-01T10:00:00.000Z",
"createdAt": "2024-01-01T10:00:00.000Z",
"updatedAt": "2024-01-01T10:00:00.000Z"
}

Common Patterns

Temporal Pattern

Implement the temporal pattern for incremental polling:

  1. Get the watermark for the key, with a Fallback Date for the first run
  2. Fetch only the records changed since that date
  3. Process them
  4. Add the new watermark once the batch has succeeded

Setting the watermark last is what makes a failed run safe: nothing moved, so the next run re-reads the same window.

Step 1: Get
Key: shopify-orders
Additional Fields → Fallback Date: 2024-01-01T00:00:00.000+00:00

Step 2: query Shopify with updated_at_min = {{ $json.date }}

Step 3: Add
Key: shopify-orders
Additional Fields → Date: (leave empty to stamp now)

Errors

Failures raise an error carrying the HTTP status from the server. With Continue on Fail enabled the item carries an error object with status, message, code and details instead of stopping the workflow.

Next Steps

Ready to explore more actions? Check out:

  1. Complete Lookup-Uniq - Map and mark in one call
  2. App Info Actions - Read the app and check server health