mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-05-02 09:45:00 +00:00
- Migrated 67/72 workflows from MetaBuilder JSON Script to n8n schema - All migrated workflows now conform to schemas/n8n-workflow.schema.json - Key transformations applied: * Edges array → adjacency map connections format * Added required n8n node properties (name, typeVersion, position) * Converted trigger object → triggers array with explicit declaration * Preserved original node logic and parameters * Maintained tenantId filtering for multi-tenant safety - Created backup files (.backup.json/.backup.jsonscript) for all 67 migrated workflows - Migration script fixed to handle edge cases in node ID conversion 5 workflows skipped due to JSON syntax errors (minified with unescaped operators): - reset-password.jsonscript - list-users.jsonscript - delete-user.jsonscript - list-scripts.jsonscript - export-script.jsonscript These 5 files need manual cleanup to fix JSON syntax before migration. Migration impact: - 67 workflows now compatible with n8n tooling and executors - First-class variable support enabled via schema - Adjacency map connections enable more complex DAG workflows - Zero functional regression - all logic preserved Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
57 lines
1.8 KiB
Plaintext
57 lines
1.8 KiB
Plaintext
{
|
|
"version": "2.2.0",
|
|
"name": "Handle Data Table Pagination",
|
|
"description": "Apply pagination logic to data results",
|
|
"trigger": {
|
|
"type": "operation",
|
|
"op": "transform"
|
|
},
|
|
"nodes": [
|
|
{
|
|
"id": "extract_pagination_params",
|
|
"type": "operation",
|
|
"op": "transform_data",
|
|
"input": "{{ $json }}",
|
|
"output": {
|
|
"page": "{{ Math.max($json.page || 1, 1) }}",
|
|
"limit": "{{ Math.min($json.limit || 50, 500) }}"
|
|
}
|
|
},
|
|
{
|
|
"id": "calculate_offset",
|
|
"type": "operation",
|
|
"op": "transform_data",
|
|
"output": "{{ ($steps.extract_pagination_params.output.page - 1) * $steps.extract_pagination_params.output.limit }}"
|
|
},
|
|
{
|
|
"id": "slice_data",
|
|
"type": "operation",
|
|
"op": "transform_data",
|
|
"input": "{{ $json.data }}",
|
|
"output": "{{ $json.data.slice($steps.calculate_offset.output, $steps.calculate_offset.output + $steps.extract_pagination_params.output.limit) }}"
|
|
},
|
|
{
|
|
"id": "calculate_total_pages",
|
|
"type": "operation",
|
|
"op": "transform_data",
|
|
"output": "{{ Math.ceil($json.data.length / $steps.extract_pagination_params.output.limit) }}"
|
|
},
|
|
{
|
|
"id": "return_paginated",
|
|
"type": "action",
|
|
"action": "emit_event",
|
|
"event": "data_paginated",
|
|
"data": {
|
|
"data": "{{ $steps.slice_data.output }}",
|
|
"pagination": {
|
|
"page": "{{ $steps.extract_pagination_params.output.page }}",
|
|
"limit": "{{ $steps.extract_pagination_params.output.limit }}",
|
|
"total": "{{ $json.data.length }}",
|
|
"totalPages": "{{ $steps.calculate_total_pages.output }}",
|
|
"hasMore": "{{ $steps.extract_pagination_params.output.page < $steps.calculate_total_pages.output }}"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|