I have requirement for triggering workflow for every new entry created in databa

I have requirement for triggering workflow for every new entry created in database for the day. Could anyone please suggest what are possible solutions and which could be the best efficient approach.

OriginalPostID-168642

OriginalPostID-168642

  Discussion posts and replies are publicly visible

  • Hi, we use an Appian process that polls the database every 5 minutes, retrieving batches of 50 records at a time.

    Mike
  • To add onto Mike's answer above (and this is dependent on your use case), you could also have a process that runs each night/morning to spawn the days/next days processes.
  • 0
    Certified Lead Developer
    You can configure Process model (A) start node to receive message . Send message to A from process (B) which creates event.
  • @parvezs I guess the viable approach is as suggested by other practitioners. Apart from the technical implementation as suggested above, there are a few things as follows which you may need to consider from design perspective to make it efficient and fail safe if the spawning is asynchronous:
    1. Query the records before hand, and that too in form of batches. Don't maintain a huge chunk of data in process variable by querying with batchSize = -1, instead query a minimal set of records in an iterative approach. In this way you can prevent process from holding huge datasets.
    2. Decide the size (amount of records to query and also for initiating a new process for the corresponding records) based on the operations that are carried out inside the newly created process. If you think that the newly created process employs heavy write/ read operations or complex expressions, make sure that the batch size is significantly small. Problematic design could lead to exhaustive connection pool which could lead to process failure or high resource consumption which would make the system very slow especially when this scheduled process runs.
    3. If possible try to initiate the new processes by making use of messaging because processes that are triggered as a subprocesses will run on the same execution engine as the parent process does. (Refer 'Uneven process instance distribution' section at https://forum.appian.com/suite/help/7.10/Appian_Health_Check.html). I guess this suggestion is more or less similar to pointer by @sharads.
    4. If there are any complex expression rules(that does complex operations)/query rules(that retrieves many records)/write to data store operations(that writes records)/or slow running smart servies in the newly created process, try to optimise them as much as possible, as the spawned instances triggers these operations in multiple instances at same time which could thereby cause performance issues.

    I guess it would be good to consider above aspects at the time of design irrespective of the time (day or night) you are going to run at, irrespective of the size (5, 10 or 50 etc) you may want to handle. Because there could be many other batch processes/ other normal operations that runs at any time which might want to engage the processor for good amount of time and might be carrying out mempry intensive operations as well or these kind of processes might be added to the system in future. Especially if it is at day time, a bad design could lead to slow response for the site users.