Describe the problem/error/question
I’m working on building a new declarative-style community node and the API I’m working with does pagination by having a page query string parameter and in the response will be a meta object containing the current page and total pages like this:
{
assets: [...],
meta: { page: 1, total_pages: 5 }
}
When I create the pagination logic using the generic pagination to set the query string parameter, all of my fields that set query string parameters are ignored as if the pagination query string object overwrites all other parameters.
The full code for my resource can be found here: n8n-nodes-syncrormm/nodes/SyncroRmm/descriptions/assets.description.ts at master · davejlong/n8n-nodes-syncrormm · GitHub
The code with extra operations and fields removed:
import type { INodeProperties } from 'n8n-workflow';
export const assetsOperations: INodeProperties[] = [
{
displayName: 'Operation',
name: 'operation',
type: 'options',
noDataExpression: true,
displayOptions: {
show: {
resource: ['assets']
}
},
options: [
{
name: 'Get Many',
value: 'getAll',
description: 'Retrieve a list of assets',
action: 'Retrieve a list of assets',
routing: {
request: {
method: 'GET',
url: '/customer_assets',
},
operations: {
pagination: {
type: 'generic',
properties: {
continue: '={{ $response.body["meta"].page < $response.body["meta"].total_pages }}',
request: {
qs: {
page: '={{ $response.body["meta"].page ? $response.body["meta"].page + 1 : 1 }}'
}
}
}
}
},
send: {
paginate: true
},
output: {
postReceive: [
{
type: 'rootProperty',
properties: {
property: 'assets'
}
}
]
},
}
}
],
default: 'getAll'
}
]
export const assetsFields: INodeProperties[] = [
// ---------------------------------
// assets:getAll
// ---------------------------------
{
displayName: 'Filters',
name: 'filters',
type: 'collection',
placeholder: 'Add Filter',
default: {},
displayOptions: {
show: {
resource: ['assets'],
operation: ['getAll']
}
},
// This query string property doesn't get set unless I comment out
// all the pagination logic above in the `getAll` operation.
options: [
{
displayName: 'Customer ID',
name: 'customerId',
type: 'number',
default: undefined,
description: 'Filter assets by Customer ID',
routing: {
send: {
type: 'query',
property: 'customer_id'
}
}
},
]
}
]
n8n Version: 1.79.3
Database: sqlite
Running via Docker on Windows