Digibee Documentation
Request documentationBook a demo
English
English
  • Quick start
  • Highlights
    • Release notes
      • Release notes 2025
        • May
        • April
        • March
        • February
        • January
      • Release notes 2024
        • December
        • November
        • October
        • September
        • August
          • Connectors release 08/20/2024
        • July
        • June
        • May
        • April
        • March
        • February
        • January
      • Release notes 2023
        • December
        • November
        • October
        • September
        • August
        • July
        • June
        • May
        • April
        • March
        • February
        • January
      • Release notes 2022
        • December
        • November
        • October
        • September
        • August
        • July
        • June
        • May
        • April
        • March
        • February
        • January
      • Release notes 2021
      • Release notes 2020
    • AI Pair Programmer
    • Digibeectl
      • Getting started
        • How to install Digibeectl on Windows
      • Digibeectl syntax
      • Digibeectl operations
  • Digibee in action
    • Use Cases in Action
      • Improving integration performance with API pagination
      • Automating file storage with Digibee
      • Reprocessing strategy in event-driven integrations
      • Key practices for securing sensitive information in pipelines with Digibee
      • OAuth2 for secure API access
      • Secure your APIs with JWT in Digibee
      • Integration best practices for developers on the Digibee Integration Platform
      • How to use Event-driven architecture on the Digibee Integration Platform
      • Dynamic file download with Digibee
      • Microservices: Circuit Breaker pattern for improving resilience
      • Error handling strategy in event-driven integrations
    • Troubleshooting
      • Integration guidance
        • How to resolve common pipeline issues
        • How to resolve Error 409: “You cannot update a pipeline that is not on draft mode”
        • How to resolve the "Pipeline execution was aborted" error
        • Integrated authentication with Microsoft Entra ID
        • How to resolve the "Failed to initialize pool: ONS configuration failed" error
        • How to perform IP address mapping with Progress database
        • How to build integration flows that send error notifications
        • How to send logs to external services
        • How JSONPath differs in connectors and the Execution panel
        • Using JSONPath to validate numbers with specific initial digits
        • How to analyze the "Network error: Failed to fetch" in the Execution panel
        • How to handle request payloads larger than 5MB
        • How to configure Microsoft Entra ID to display groups on the Digibee Integration Platform
        • How to build an HL7 message
      • Connectors behavior and configuration
        • Timeout in the Pipeline Executor connector
        • How to use DISTINCT and COUNT in the Object Store
        • Understanding @@DGB_TRUNCATED@@ on the Digibee Integration Platform
        • How to resolve names without a DNS - REST, SOAP, SAP (web protocols)
        • How to read and write files inside a folder
        • AuthToken Reuse for Salesforce connector
        • How to resolve the "Invalid payload" error in API Integration
        • Supported databases
          • Functions and uses for databases
      • Connectors implementation and usage examples
        • Google Storage: Usage scenarios
        • DB V2: Usage scenarios
        • For Each: Usage example
        • Template and its uses
        • Digibee JWT implementation
        • Email V1: Usage example (Deprecated)
      • JOLT applications
        • Transformer: Getting to know JOLT
        • Transformer: Transformations with JOLT
        • Transformer: Add values to list elements
        • Transformer: Operations overview
        • Transformer: Date formatting using split and concat
        • Transformer: Simple IF-ELSE logic with JOLT
      • Platform access and performance tips
        • How to solve login problems on the Digibee Integration Platform
        • How to receive updates from Digibee Status Page
        • How to clean the Digibee Integration Platform cache
      • Governance troubleshooting guidance
        • How to consume Internal API pipelines using ZTNA
        • How to use Internal API with and without a VPN
        • How to generate, convert, and register SSH Keys
        • mTLS authentication
          • How to configure mTLS on the Digibee Integration Platform
          • FAQs: Certificates in mTLS
        • How to connect Digibee to Oracle RAC
        • How to connect Digibee to SAP
        • How to connect Digibee to MongoDB Atlas using VPN
        • How to manage IPs on the Digibee Integration Platform
        • Configuring the Dropbox account
        • How to use your Gmail account with the Digibee email component (SMTP)
        • How to use the CORS policy on the Digibee Integration Platform
      • Deployment scenarios
        • Solving the “Out of memory” errors in deployment
        • Warning of route conflicts
    • Best practices
      • Best practices for building a pipeline
      • Best practices on validating messages in a consumer pipeline
      • Avoiding loops and maximizing pipeline efficiency
      • Naming: Global, Accounts, and API Keys
      • Pagination tutorial
        • Pagination tutorial - part 1
        • Pagination tutorial - part 2
        • Pagination tutorial - part 3
        • Pagination tutorial - part 4
      • Pagination example
      • Event-driven architecture
      • Notification model in event-driven integrations
      • OAuth2 integration model with Digibee
      • Best practices for error handling in pipelines
    • Digibee Academy
      • Integration Developer Bootcamp
  • Reference guides
    • Connectors
      • AWS
        • S3 Storage
        • SQS
        • AWS Secrets Manager
        • AWS Athena
        • AWS CloudWatch
        • AWS Elastic Container Service (ECS)
        • AWS Eventbridge
        • AWS Identity and Access Management (IAM)
        • AWS Kinesis
        • AWS Kinesis Firehose
        • AWS Key Management Service (KMS)
        • AWS Lambda
        • AWS MQ
        • AWS Simple Email Service (SES)
        • AWS Simple Notification System (SNS)
        • AWS Security Token Service (STS)
        • AWS Translate
      • Azure
        • Azure CosmosDB
        • Azure Event Hubs
        • Azure Key Vault
        • Azure ServiceBus
        • Azure Storage DataLake Service
        • Azure Storage Queue Service
      • Enterprise applications
        • SAP
        • Salesforce
        • Braintree
        • Facebook
        • GitHub
        • Jira
        • ServiceNow
        • Slack
        • Telegram
        • Twilio
        • WhatsApp
        • Wordpress
        • Workday
        • Zendesk
      • File storage
        • Blob Storage (Azure)
        • Digibee Storage
        • Dropbox
        • FTP
        • Google Drive
        • Google Storage
        • OneDrive
        • SFTP
        • WebDav V2
        • WebDav (Deprecated)
      • Files
        • Append Files
        • Avro File Reader
        • Avro File Writer
        • CSV to Excel
        • Excel
        • File Reader
        • File Writer
        • GZIP V2
        • GZIP V1 (Deprecated)
        • Parquet File Reader
        • Parquet File Writer
        • Stream Avro File Reader
        • Stream Excel
        • Stream File Reader
        • Stream File Reader Pattern
        • Stream JSON File Reader
        • Stream Parquet File Reader
        • Stream XML File Reader
        • XML Schema Validator
        • ZIP File
        • NFS
      • Flow
        • Delayer
      • Google/GCP
        • Google BigQuery
        • Google BigQuery Standard SQL
        • Google Calendar
        • Google Cloud Functions
        • Google Mail
        • Google PubSub
        • Google Secret Manager
        • Google Sheets
      • Industry solutions
        • FHIR (Beta)
        • Gupy Public API
        • HL7
        • HubSpot: Sales and CMS
        • Mailgun API
        • Oracle NetSuite (Beta)
        • Orderful
        • Protheus: Billing and Inventory of Cost
      • Logic
        • Block Execution
        • Choice
        • Do While
        • For Each
        • Retry
        • Parallel Execution
      • Queues and messaging
        • Event Publisher
        • JMS
        • Kafka
        • RabbitMQ
      • Security
        • AES Cryptography
        • Asymmetric Cryptography
        • CMS
        • Digital Signature
        • JWT (Deprecated)
        • JWT V2
        • Google IAP Token
        • Hash
        • Digibee JWT (Generate and Decode)
        • LDAP
        • PBE Cryptography
        • PGP
        • RSA Cryptography
        • Symmetric Cryptography
      • Structured data
        • CassandraDB
        • DB V2
        • DB V1 (Deprecated)
        • DynamoDB
        • Google Big Table
        • Memcached
        • MongoDB
        • Object Store
        • Relationship
        • Session Management
        • Stored Procedure
        • Stream DB V3
        • Stream DB V1 (Deprecated)
        • ArangoDb
        • Caffeine Cache
        • Caffeine LoadCache
        • Couchbase
        • CouchDB
        • Ehcache
        • InfluxDB
      • Tools
        • Assert V2
        • Assert V1 (Deprecated)
        • Base64
        • CSV to JSON V2
        • CSV to JSON V1 (Deprecated)
        • HL7 Message Transformer (Beta)
        • HTML to PDF
        • Transformer (JOLT) V2
        • JSLT
        • JSON String to JSON Transformer
        • JSON to JSON String Transformer
        • JSON to XML Transformer
        • JSON to CSV V2
        • JSON to CSV Transformer (Deprecated)
        • JSON Path Transformer V2
        • JSON Path Transformer
        • JSON Transformer
        • Log
        • Pipeline Executor
        • QuickFix (Beta)
        • SSH Remote Command
        • Script (JavaScript)
        • Secure PDF
        • Store Account
        • Template Transformer
        • Throw Error
        • Transformer (JOLT)
        • Validator V1 (Deprecated)
        • Validator V2
        • XML to JSON Transformer
        • XML Transformer
        • JSON Generator (Mock)
      • Web protocols
        • Email V2
        • Email V1 (Deprecated)
        • REST V2
        • REST V1 (Deprecated)
        • SOAP V1 (Deprecated)
        • SOAP V2
        • SOAP V3
        • WGet (Download HTTP)
        • gRPC
    • Triggers
      • Web Protocols
        • API Trigger
        • Email Trigger
        • Email Trigger V2
        • HTTP Trigger
        • HTTP File Trigger
          • HTTP File Trigger - Downloads
          • HTTP File Trigger - Uploads
        • REST Trigger
      • Scheduling
        • Scheduler Trigger
      • Messaging and Events
        • Event Trigger
        • JMS Trigger
        • Kafka Trigger
        • RabbitMQ Trigger
      • Others
        • DynamoDB Streams Trigger
        • HL7 Trigger
        • Salesforce Trigger - Events
    • Double Braces
      • How to reference data using Double Braces
      • Double Braces functions
        • Math functions
        • Utilities functions
        • Numerical functions
        • String functions
        • JSON functions
        • Date functions
        • Comparison functions
        • File functions
        • Conditional functions
      • Double Braces autocomplete
  • Development cycle
    • Build
      • Canvas
        • AI Assistant
        • Smart Connector User Experience
        • Execution panel
        • Design and Inspect Mode
        • Linter: Canvas building validation
        • Connector Mocking
      • Pipeline
        • How to create a pipeline
        • How to scaffold a pipeline using an OpenAPI specification
        • How to create a project
        • Pipeline version history
        • Pipeline versioning
        • Messages processing
        • Subpipelines
      • Capsules
        • How to use Capsules
          • How to create a Capsule collection
            • Capsule header dimensions
          • How to create a Capsule group
          • How to configure a Capsule
          • How to build a Capsule
          • How to test a Capsule
          • How to save a Capsule
          • How to publish a Capsule
          • How to change a Capsule collection or group
          • How to archive and restore a Capsule
        • Capsules versioning
        • Public capsules
          • SAP
          • Digibee Tools
          • Google Sheets
          • Gupy
          • Send notifications via email
          • Totvs Live
          • Canvas LMS
        • AI Assistant for Capsules Docs Generation
    • Run
      • Run concepts
        • Autoscalling
      • Deployment
        • Deploying a pipeline
        • How to redeploy a pipeline
        • How to promote pipelines across environments
        • How to check the pipeline deployment History
        • How to rollback to a previous deployment version
        • Using deployment history advanced functions
        • Pipeline deployment status
      • How warnings work on pipelines in Run
    • Monitor
      • Monitor Insights (Beta)
      • Completed executions
        • Pipeline execution logs download
      • Pipeline logs
      • Pipeline Metrics
        • Pipeline Metrics API
          • How to set up Digibee API metrics with Datadog
          • How to set up Digibee API metrics with Prometheus
        • Connector Latency
      • Alerts
        • How to create an alert
        • How to edit an alert
        • How to activate, deactivate or duplicate an alert
        • How to delete an alert
        • How to configure alerts on Slack
        • How to configure alerts on Telegram
        • How to configure alerts through a webhook
        • Available metrics
        • Best practices about alerts
        • Use cases for alerts
      • VPN connections monitoring
        • Alerts for VPN metrics
  • Connectivity management
    • Connectivity
    • Zero Trust Network Access (ZTNA)
      • Prerequisites for using ZTNA
      • How to view connections (Edge Routers)
      • How to view the Network Mappings associated with an Edge Router
      • How to add new ZTNA connections (Edge Routers)
      • How to delete connections (Edge Routers)
      • How to view routes (Network Mapping)
      • How to add new routes (Network Mapping)
      • How to add routes in batch for ZTNA
      • How to edit routes (Network Mapping)
      • How to delete routes (Network Mapping)
      • How to generate new keys (Edge Router)
      • How to change the environment of Edge routers
      • ZTNA Inverse Flow
      • ZTNA Groups
    • Virtual Private Network (VPN)
  • Platform administration
    • Administration
      • Audit
      • Access control
        • Users
        • Groups
        • Roles
          • List of permissions by service
          • Roles and responsibilities: Governance and key stakeholder identification
      • Identity provider integration
        • How to integrate an identity provider
        • Authentication rules
        • Integration of IdP groups with Digibee groups
          • How to create a group integration
          • How to test a group integration
          • How to enable group integrations
          • How to edit a group integration
          • How to delete a group integration
      • User authentication and authorization
        • How to activate and deactivate two-factor authentication
        • Login flow
      • Organization groups
    • Settings
      • Globals
        • How to create Globals
        • How to edit or delete Globals
        • How to use Globals
      • Accounts
        • Configuring each account type
        • Monitor changes to account settings in deployed pipelines
        • OAuth2 Architecture
          • Registration of new OAuth providers
      • Consumers (API Keys)
      • Relationship model
      • Multi-Instance
        • Deploying a multi-instance pipeline
      • Log Streaming
        • How to use Log Streaming with Datadog
    • Governance
      • Policies
        • Security
          • Internal API access policy
          • External API access policy
          • Sensitive fields policy
        • Transformation
          • Custom HTTP header
          • CORS HTTP header
        • Limit of Replicas policy
    • Licensing
      • Licensing models
        • Consumption Based model
      • Capacity and quotas
      • License consumption
    • Digibee APIs
      • How to create API credentials
  • Digibee concepts
    • Pipeline Engine
      • Digibee Integration Platform Pipeline Engine v2
      • Support Dynamic Accounts (Restricted Beta)
    • Digibee Integration Platform Dedicated SaaS
      • Digibee Integration Platform architecture on Dedicated Saas model
      • Requirements for Digibee Dedicated Saas model
      • Site-to-Site VPN for dedicated SaaS customer support
      • Dedicated Saas customer responsibilities
      • Custom Images of Kubernetes Nodes
      • Digibee Dedicated SaaS installation on AWS
        • How to install requirements before installing Digibee Integration Platform on EKS
        • Permissions to use Digibee Integration Platform on EKS
        • How to create custom nodes for EKS (Golden Images)
    • Introduction to ZTNA
  • Help & FAQ
    • Digibee Customer Support
    • Request documentation, suggest features, or send feedback
    • Beta Program
    • Security and compliance
    • About Digibee
Powered by GitBook
On this page

Was this helpful?

  1. Digibee in action
  2. Best practices

Pagination tutorial

Processing large amounts of data at once can lead to errors. Learn how pagination lets users split data querying processes and retrieve a limited number of records.

PreviousNaming: Global, Accounts, and API KeysNextPagination tutorial - part 1

Was this helpful?

When you build an integration flow, you may need to process large amounts of data. Processing all of that data at once can lead to errors such as a timeout error or an Out of Memory (OOM) error. One solution to this problem is pagination. Using pagination, you can split the data querying process into batches and retrieve only a limited number of records at a time.

In the following articles, we will guide you on how to implement pagination in a flow that makes a total migration of an HR database every day at 1 AM.

When you copy components on the Digibee Integration Platform, they are stored on your clipboard as JSON objects. The JSON object that refers to this pagination pipeline is available on the expandable block at the end of this article. You can copy and paste it into the Canvas and modify it as needed for your integration flow.

Before implementing pagination, you need to check if the API, database or web service you are querying supports pagination. If not, you can still improve the performance of your integration flow by increasing the deployment size of your pipelines.

In this example, the pagination flow is triggered every five minutes. It starts with a sequence of initial steps. After these steps, it splits into three paths, as displayed below:

  • The flow follows the “FINISHED” path if the data migration process has already ended for the day or if it is not yet time to start it.

  • The flow follows the “EXTRACTING_DATA” path when it is time to start the data migration process and this process is not yet completed.

  • The flow follows the error path if an error occurs during the initial steps.

In the following articles, we will give you step-by-step instructions on how to build each of these paths.

{ "meta": { "trigger": { "position": { "x": 41, "y": 173 } }, "b5ff08e4-4be2-4363-8315-94f2f8e330e1": { "position": { "x": 173, "y": 173 } }, "43f2edbb-bfb4-401d-9268-b249a9647a7c": { "position": { "x": 305, "y": 173 } }, "94d7c8aa-b933-4215-90da-9e444694cc7a": { "position": { "x": 437, "y": 173 } }, "4603fa33-63ff-4a21-8b9e-f36d292bd856": { "position": { "x": 574, "y": 173 } }, "c956b8a4-11b1-43e6-9071-cc75e6406f6c": { "position": { "x": 861, "y": 173 } }, "512fae5f-9eb5-47fa-ab4b-afccafd04271": { "position": { "x": 998, "y": 173 } }, "2bcd9f6a-a9ef-456a-824d-120b33d9b180": { "position": { "x": 1135, "y": 173 } }, "68cb6d2e-8c4c-4955-9043-bd9a19ddfb78": { "position": { "x": 1267, "y": 173 } }, "399e154c-2f04-4089-adba-54505537a5d8": { "position": { "x": 1399, "y": 173 } }, "190ff285-eed4-4284-80fa-67eaf50a9567": { "position": { "x": 1536, "y": 173 } }, "10cf847e-1841-4f51-9070-61e0c90ea9f5": { "position": { "x": 1915, "y": 239 } }, "6ecdab96-f805-40da-9042-43213767fcdc": { "position": { "x": 2047, "y": 239 } }, "a7ead047-b435-4c93-a11c-d5b43a8ca36a": { "position": { "x": 2179, "y": 239 } }, "c8335fac-e519-46f2-84cb-aa5e9c24ac85": { "position": { "x": 2311, "y": 239 } }, "64f5b700-8f85-4bbd-b13f-6dd417dcb71a": { "position": { "x": 1915, "y": 107 } }, "75fc8b48-27d7-4a98-95d8-444c87ac2834": { "position": { "x": 2047, "y": 107 } }, "9ef51996-056b-42a7-ae84-f0f2764fb356": { "position": { "x": 2179, "y": 107 } }, "04871318-a796-44b2-8862-b2265a1b5a48": { "position": { "x": 2311, "y": 107 } }, "bfe65bda-ad52-469b-807b-71163faba44c": { "position": { "x": 763.0364291711267, "y": 421.53565929452884 } }, "5d0c17ca-4d0d-4e58-9c86-d50e8d8c97e4": { "position": { "x": 998, "y": 414 } }, "b77a096e-558d-44bc-bb05-e0906f2e943a": { "position": { "x": 1536, "y": 482.5 } }, "57f8478b-1675-4d3a-83d0-a5c8d19b60a1": { "position": { "x": 1678, "y": 482.5 } }, "3695db00-d82e-4f8c-818e-10883acdf1b8": { "position": { "x": 2047, "y": 411.5 } }, "5387162d-d9a9-473d-8adf-14adabadcd35": { "position": { "x": 2179, "y": 411.5 } }, "d5213b0b-a44d-4c88-a046-913e82d7bcc6": { "position": { "x": 2311, "y": 410.5 } }, "fc73381f-54e8-44f3-b830-3f2a541a183b": { "position": { "x": 2047, "y": 548.5 } }, "f354b82b-8518-4509-b703-04133ed767d3": { "position": { "x": 2179, "y": 548.5 } }, "c3b39a8c-3bbf-4f4e-aad8-f2851e26d34a": { "position": { "x": 1536, "y": 345.5 } }, "f23200ca-8203-4adf-a07d-8bc779088bc5": { "position": { "x": 1678, "y": 345.5 } }, "d25738e8-bd93-4f53-9d1e-ccd9a255e852": { "position": { "x": 861, "y": 41 } }, "f7a84b35-d8ff-4750-adf7-f71a97e05acd": { "position": { "x": 998, "y": 41 } } }, "flowSpec": { "disconnected-root:a7cb376f-7012-46f8-85de-64547c319707": [ { "stepName": "get pagination parameters", "accountLabel": "dgb-internal-object-store-account", "params": { "operation": "FIND", "objectStore": "pagination-OS-example", "objectId": "{{ CONCAT(metadata.pipeline.name, "_v" , metadata.pipeline.versionMajor) }}", "limit": "0", "skip": "0", "sort": "{}", "unique": true, "isolated": false, "upsert": false, "failOnError": false }, "id": "b5ff08e4-4be2-4363-8315-94f2f8e330e1", "type": "connector", "name": "object-store-connector" }, { "stepName": "create default values", "params": { "json": "{\n "control":{\n "startTimestamp": {{ metadata.execution.startTimestamp }},\n "limit": {{ DEFAULT( message.data[0].limit, 500 ) }},\n "start": {{ DEFAULT( message.data[0].start, 0 ) }},\n "end": {{ DEFAULT( message.data[0].end, 500 ) }},\n "step": {{ DEFAULT( message.data[0].step, "FINISHED" ) }},\n "nextExecutionTimestamp": {{ message.data[0].nextExecutionTimestamp }}\n }\n}", "failOnError": false }, "id": "43f2edbb-bfb4-401d-9268-b249a9647a7c", "type": "connector", "name": "json-generator-connector" }, { "type": "session-management", "stepName": "put control", "operation": "PUT", "sessionType": "LOCAL", "scoped": false, "fields": [ "control" ], "id": "94d7c8aa-b933-4215-90da-9e444694cc7a" }, { "stepName": "check step", "id": "4603fa33-63ff-4a21-8b9e-f36d292bd856", "type": "choice", "when": [ { "jsonPath": "$.control.[?(@.step == 'EXTRACTING_DATA')]", "target": "EXTRACTING_DATA (1)" }, { "jsonPath": "$.control.[?(@.step == 'FINISHED')]", "target": "FINISHED (1)" } ], "otherwise": "error - unknown step" } ], "EXTRACTING_DATA (1)": [ { "type": "connector", "name": "log-connector", "stepName": "Log - EXTRACTING_DATA", "params": { "logLevel": "INFO", "message": " EXTRACTING_DATA" }, "id": "c956b8a4-11b1-43e6-9071-cc75e6406f6c" }, { "stepName": "select enb_person", "accountLabel": "mysql-2", "params": { "url": "{{global.enablement-db-url}}", "sql": "select * from enb_person limit {{ message.control.start }}, {{ message.control.limit }}", "itemIdentifier": "codigo", "parallel": false, "blobAsFile": false, "clobAsFile": false, "failOnError": false, "connectionProperties": "{}", "keepConnection": true, "advanced": false, "dbPoolByActualConsumers": false, "exclusiveDbPool": false, "columnFromLabel": false, "connectionTestQuery": "", "onProcess": "512fae5f-9eb5-47fa-ab4b-afccafd04271-onProcessTrack", "onException": "512fae5f-9eb5-47fa-ab4b-afccafd04271-onExceptionTrack" }, "id": "512fae5f-9eb5-47fa-ab4b-afccafd04271", "type": "connector", "name": "stream-db-connector-v3" }, { "stepName": "group summary", "params": { "json": "{\n "summary": {{ message.$ }}\n}", "failOnError": false }, "id": "2bcd9f6a-a9ef-456a-824d-120b33d9b180", "type": "connector", "name": "json-generator-connector" }, { "stepName": "put summary", "operation": "PUT", "sessionType": "LOCAL", "fields": [ "summary" ], "scoped": false, "id": "68cb6d2e-8c4c-4955-9043-bd9a19ddfb78", "type": "session-management" }, { "type": "session-management", "stepName": "get control", "operation": "GET", "sessionType": "LOCAL", "scoped": false, "fields": [ "control" ], "id": "399e154c-2f04-4089-adba-54505537a5d8" }, { "type": "choice", "stepName": "Choice", "when": [ { "jsonPath": "$.[?(@.summary.total < @.control.limit)]", "target": "pagination is over" } ], "otherwise": "next page", "id": "190ff285-eed4-4284-80fa-67eaf50a9567" } ], "512fae5f-9eb5-47fa-ab4b-afccafd04271-onProcessTrack": [ { "stepName": "publish processing event", "params": { "eventName": "evt-proc-handson-architecture-danilo-loose-t33", "body": "{{ message.$ }}", "showSendEventLog": false, "stopOnError": false }, "id": "d872bc41-d300-4d08-840e-d05cbbb46420", "type": "connector", "name": "event-publisher-connector" }, { "stepName": "success message", "params": { "json": "{\n "success": true\n}", "failOnError": false }, "id": "2cb6cf22-c9d1-4c3b-8afc-c0eef532ec2e", "type": "connector", "name": "json-generator-connector" } ], "512fae5f-9eb5-47fa-ab4b-afccafd04271-onExceptionTrack": [ { "stepName": "Log - onException Stream DB", "params": { "logLevel": "ERROR", "message": "onException stream DB" }, "id": "f3c5ba58-35a1-4830-b1cf-570668f86bcc", "type": "connector", "name": "log-connector" }, { "stepName": "Publish error event", "params": { "eventName": "error-event-pagination", "body": "{{ message.$ }}", "showSendEventLog": false, "stopOnError": false }, "id": "46061315-89ca-46a7-ba84-3ead41a50ab2", "type": "connector", "name": "event-publisher-connector" }, { "type": "connector", "name": "throw-error-connector", "stepName": "Throw Error", "params": { "errorMessage": "Error occurred.", "errorCode": 500, "customErrorEnabled": false, "failOnError": true }, "id": "70abcbbf-5048-4145-8ed8-646230c29542" } ], "pagination is over": [ { "stepName": "Log - pagination is over", "params": { "logLevel": "WARN", "message": "acabou a paginação" }, "id": "10cf847e-1841-4f51-9070-61e0c90ea9f5", "type": "connector", "name": "log-connector" }, { "stepName": "update pagination parameters", "accountLabel": "dgb-internal-object-store-account", "params": { "operation": "UPDATE", "objectStore": "pagination-OS-example", "objectId": "{{ CONCAT(metadata.pipeline.name, "_v" , metadata.pipeline.versionMajor) }}", "document": "{\n $set:{\n "start": 0,\n "end": null,\n "step": "FINISHED",\n "nextExecutionTimestamp": {{ FORMATDATE(FORMATDATE(SUMDATE( NOW() , "DAY", 1), "timestamp", "dd/MM/yyyy 01:00:00"), "dd/MM/yyyy HH:mm:ss", "timestamp") }}\n }\n}", "unique": true, "isolated": false, "upsert": true, "failOnError": false }, "id": "6ecdab96-f805-40da-9042-43213767fcdc", "type": "connector", "name": "object-store-connector" }, { "operation": "GET", "scoped": false, "sessionType": "LOCAL", "stepName": "get control", "fields": [ "control" ], "type": "session-management", "id": "a7ead047-b435-4c93-a11c-d5b43a8ca36a" }, { "stepName": "set output", "params": { "json": "{\r\n "message": {{ CONCAT("Migration will start at ", FORMATDATE( message.control.nextExecutionTimestamp, "timestamp", "dd/MM/yyyy HH:mm:ss")) }}\r\n}\r\n", "failOnError": false }, "id": "c8335fac-e519-46f2-84cb-aa5e9c24ac85", "type": "connector", "name": "json-generator-connector" } ], "next page": [ { "stepName": "Log - next page", "params": { "logLevel": "INFO", "message": "proxima pagina" }, "id": "64f5b700-8f85-4bbd-b13f-6dd417dcb71a", "type": "connector", "name": "log-connector" }, { "stepName": "update pagination parameters", "accountLabel": "dgb-internal-object-store-account", "params": { "operation": "UPDATE", "objectStore": "pagination-OS-example", "objectId": "{{ CONCAT(metadata.pipeline.name, "_v" , metadata.pipeline.versionMajor) }}", "document": "{\n $set:{\n "start": {{ message.control.end }},\n "end": {{ TOINT(SUM(message.control.end, message.control.limit)) }},\n "step": "EXTRACTING_DATA"\n }\n}", "unique": true, "isolated": false, "upsert": true, "failOnError": false }, "id": "75fc8b48-27d7-4a98-95d8-444c87ac2834", "type": "connector", "name": "object-store-connector" }, { "stepName": "update pagination parameters", "accountLabel": "dgb-internal-object-store-account", "params": { "operation": "FIND", "objectStore": "pagination-OS-example", "objectId": "{{ CONCAT(metadata.pipeline.name, "_v" , metadata.pipeline.versionMajor) }}", "limit": "0", "skip": "0", "sort": "{}", "unique": true, "isolated": false, "upsert": false, "failOnError": false }, "id": "9ef51996-056b-42a7-ae84-f0f2764fb356", "type": "connector", "name": "object-store-connector" }, { "stepName": "set output", "params": { "json": "{\n "message": "The data is being migrated.",\n "next_execution": {{ message.data[0] }}\n}", "failOnError": false }, "id": "04871318-a796-44b2-8862-b2265a1b5a48", "type": "connector", "name": "json-generator-connector" } ], "FINISHED (1)": [ { "stepName": "Log - FINISHED", "params": { "logLevel": "INFO", "message": "FINISHED" }, "id": "bfe65bda-ad52-469b-807b-71163faba44c", "type": "connector", "name": "log-connector" }, { "type": "choice", "stepName": "Choice", "when": [ { "jsonPath": "$.[?(@.control.nextExecutionTimestamp != null)]", "target": "nextExecutionTimestamp is not null" } ], "otherwise": "nextExecutionTimestamp is null", "id": "5d0c17ca-4d0d-4e58-9c86-d50e8d8c97e4" } ], "nextExecutionTimestamp is not null": [ { "stepName": "Log - nextExecutionTimestamp is not null", "params": { "logLevel": "INFO", "message": "nextExecution preenchido" }, "id": "b77a096e-558d-44bc-bb05-e0906f2e943a", "type": "connector", "name": "log-connector" }, { "type": "choice", "stepName": "Choice", "when": [ { "jsonPath": "$.control.[?(@.startTimestamp>= @.nextExecutionTimestamp)]", "target": "restart migration" } ], "otherwise": "wait until next migration", "id": "57f8478b-1675-4d3a-83d0-a5c8d19b60a1" } ], "restart migration": [ { "stepName": "Log - restart migration", "params": { "logLevel": "INFO", "message": "recomeçar a migração" }, "id": "3695db00-d82e-4f8c-818e-10883acdf1b8", "type": "connector", "name": "log-connector" }, { "stepName": "update pagination parameters", "accountLabel": "dgb-internal-object-store-account", "params": { "operation": "UPDATE", "objectStore": "pagination-OS-example", "objectId": "{{ CONCAT(metadata.pipeline.name, "_v" , metadata.pipeline.versionMajor) }}", "document": "{\n $set:{\n "step": "EXTRACTING_DATA"\n }\n}", "unique": true, "isolated": false, "upsert": true, "failOnError": false }, "id": "5387162d-d9a9-473d-8adf-14adabadcd35", "type": "connector", "name": "object-store-connector" }, { "stepName": "set output", "params": { "json": "{\n "message": "Migration will start at the next execution."\n}", "failOnError": false }, "id": "d5213b0b-a44d-4c88-a046-913e82d7bcc6", "type": "connector", "name": "json-generator-connector" } ], "wait until next migration": [ { "stepName": "Log - wait until next migration", "params": { "logLevel": "INFO", "message": "esperar" }, "id": "fc73381f-54e8-44f3-b830-3f2a541a183b", "type": "connector", "name": "log-connector" }, { "stepName": "set output", "params": { "json": "{\n "mensagem": {{ CONCAT("Migration will begin at ", FORMATDATE( message.control.nextExecutionTimestamp, "timestamp", "dd/MM/yyyy HH:mm:ss")) }}\n}", "failOnError": false }, "id": "f354b82b-8518-4509-b703-04133ed767d3", "type": "connector", "name": "json-generator-connector" } ], "nextExecutionTimestamp is null": [ { "stepName": "Log - nextExecutionTimestamp is null", "params": { "logLevel": "WARN", "message": "nextExecution nulo" }, "id": "c3b39a8c-3bbf-4f4e-aad8-f2851e26d34a", "type": "connector", "name": "log-connector" }, { "stepName": "update pagination parameters", "accountLabel": "dgb-internal-object-store-account", "params": { "operation": "UPDATE", "objectStore": "pagination-OS-example", "objectId": "{{ CONCAT(metadata.pipeline.name, "_v" , metadata.pipeline.versionMajor) }}", "document": "{\n $set:{\n "nextExecutionTimestamp": {{ FORMATDATE(FORMATDATE(SUMDATE( NOW() , "DAY", 1), "timestamp", "dd/MM/yyyy 01:00:00"), "dd/MM/yyyy HH:mm:ss", "timestamp") }}\n }\n}", "unique": true, "isolated": false, "upsert": true, "failOnError": false }, "id": "f23200ca-8203-4adf-a07d-8bc779088bc5", "type": "connector", "name": "object-store-connector" } ], "error - unknown step": [ { "stepName": "Log - error unkown step", "params": { "logLevel": "ERROR", "message": "Error processing message {{ message.$.myField }}" }, "id": "d25738e8-bd93-4f53-9d1e-ccd9a255e852", "type": "connector", "name": "log-connector" }, { "type": "connector", "name": "throw-error-connector", "stepName": "Throw Error", "params": { "errorMessage": "Error occurred.", "errorCode": 500, "customErrorEnabled": false, "failOnError": true }, "id": "f7a84b35-d8ff-4750-adf7-f71a97e05acd" } ] } }
Pagination pipeline