How to create multiple file ID for the same process?

My Anaplan model is connected to an outside system by API, user can accept or reject a request in a workflow in the outside system and the result is transferred to Anaplan by API, then Anaplan will refer to the result file and update the status to proved/rejected.

However when multiple users run the same workflow at the same time, different result files with the same file ID is transferred to Anaplan. As Anaplan cannot do the parallel processing, the second processing result will override the first one, causing the loss of the first result.
As it is a specification of Anaplan, is there a workaround or is it possible to add branch numbers to the file ID for the same process?

Thx.

Tagged:

Answers

  • Hello,
    To address the issue of concurrent processing with multiple users running the same workflow in Anaplan, there are a few strategies you can explore, as Anaplan does not natively support parallel processing of requests with the same file ID. Here are some potential workarounds:

    1. Branch Numbers or Unique File IDs
      As you suggested, you can introduce branch numbers or unique identifiers in the file IDs. This would allow each API request to generate a distinct file ID, preventing the overwriting of results. This can be done by appending a timestamp, user ID, or a sequential branch number to the file ID in your system before sending it to Anaplan. This would help ensure that each request is treated as a unique entry in Anaplan, avoiding conflicts.

    For example:

    FileID_20231130_123456 (Timestamp-based)
    FileID_User123_001 (User and branch-based)
    Ensure that the logic in your API call creates a unique file ID for each concurrent workflow request.

    1. Staggered Updates via Queues
      If changing the file ID structure is not feasible, another approach is to manage the processing order using a queuing mechanism. You can implement a queue system in your external system to process requests one by one, ensuring that each request is processed sequentially within Anaplan. This prevents race conditions where multiple requests might try to update the same file ID simultaneously.

    Queue Management: Requests could be queued and processed in batches or sequentially, ensuring that the file ID conflict does not occur.
    Locking Mechanism: A locking mechanism could be applied to prevent simultaneous updates from different users on the same workflow, with each request waiting its turn.
    3. Using a Staging Area
    Instead of directly updating the file in Anaplan, you can implement a "staging area" where results from multiple workflows are temporarily stored with unique identifiers. Once all users have submitted their results, a batch process can be run to consolidate the results and update the status in Anaplan. This way, the data is collected first, and then processed sequentially to prevent overwriting.

    1. Change the API Integration Logic
      Another workaround is to adjust the integration logic on the API side. If you can modify how the API sends data to Anaplan, you could implement a versioning or incremental update strategy, where updates are applied to the file only if they meet specific conditions (e.g., if the status has changed or if the file ID has not yet been processed). This approach would require more advanced logic but could prevent overwriting data.
    2. Using Anaplan's Built-in Actions
      If you are leveraging Anaplan's own integration and file import actions, another approach could be to adjust the process flow by adding conditional checks in Anaplan itself (using lists, modules, and formula-driven checks) to handle situations where multiple results are imported in close succession. Anaplan's "Import Data" actions could be configured to only update the status if the file's status hasn't already been processed, though this may require additional logic to handle concurrent updates manually.

    Conclusion
    The most direct solution to your problem is adding unique identifiers to the file IDs to ensure each result file is processed separately without overwriting. Implementing unique file IDs, like adding timestamps or user-specific identifiers, would allow Anaplan to distinguish between results coming from multiple users and prevent data loss from overwriting.
    Best Regards
    merry678
    Securly Login