Subprocess elements limit

Hi, is there any limit on number of elements in any subprocess?
We create agi-call flow using bpmn-modeller, we can introduce several custom components in the flow such as: User input, Voice, Record Voice etc.
We can also create a subprocess which can include our custom components.

Now, for AGI calling we have used asterisk, and bpmn-engine to load the flow while agi calling.

My doubts are regarding modeller and engine:

  • Whenever we create any new subprocess and expand it, it creates a start event by default, but does not adds end event (bpmn:IntermediateThrowEvent), why is it so?

  • What exactly is the role of 'bpmn:IntermediateThrowEvent, does it throw any event or is it a simple end event?

We are using following process to create an instance of engine and implement onStart and onWait, which is executed at start of an AGI call:

bpmnEngine = Engine({
      name: 'Call Listener', extensions: {
        bpmnSaveServiceResultToVar, bpmnActivityHandler
      }
    });

    const sourceContext = await getSourceContext(session, xmlData);
    bpmnEngine.addSource({ sourceContext });
    console.log("Loading BPMN flow");
    activityListener.on("wait", BpmnActivityHandler.onWait);

    bpmnEngine.on(EVENT_TYPES.BPMN.END, () => {
      console.log("AGI call ended");
    });

    await bpmnEngine.execute({
      listener: activityListener,
      // activity variables
      variables: {
        var1: var1,
        var2: var2
      },
      services: { ...listOfServices }
    });

and function bpmnActivityHandler:

return {
    activate() {
      bpmnActivity.on("enter", async (elementApi, engineApi) => {
        bpmnActivity.broker.publish('format', 'run.format.start', { endRoutingKey: 'run.format.complete' });
        try {
          const response = await BpmnActivityHandler.onStart(elementApi, engineApi);
          // response (true: continue the call, false: ended the call)
          // returning only in case of false response to exit the activate block.
          if (!response) {
            // exiting the activate block
            return false;
          }
        } catch (err) {
          console.error("Error:",err);
          return CallService.endCall();
        }
        bpmnActivity.broker.publish('format', 'run.format.complete', { msg: "testmm" });
      }, { consumerTag: 'format-on-enter' });
    },
    deactivate() {
      bpmnActivity.broker.cancel('format-on-enter');
    },
  };
}

Now the issue I am facing is that I am using multiple custom components (around 40-50 components) inside a single subprocess, but after a point it does not ends the subprocess, i.e. the AGI call continues and gets stuck at the end, it should have moved to next subprocess, but it gets stuck. There is no issue in custom component, it is due to bpmn-engine, because when I remove a part of subprocess, it works fine, but I don’t want to do so.
Can someone please help me with these doubts?

What exactly do you mean with “after a point it does not ends the subprocess”?

Are you executing the process somewhere? Is there an error message you can share with us?

There is no error message, it is just reflecting issues during AGI call. I have updated the question with more description. Please help!!

It looks like your question is not related to our project or one of our toolkits. We do not provide Are you sure this is the correct place for this question? For questions regarding other tools (Asterisk, bpmn-engine), please refer to their respective communication channels.

Thank you :sunny:

Ok, can you please tell the significance of bpmn:IntermediateThrowEvent, why the bpmn model does not add it by default in a subprocess and adds start event by default and also what does it throws?

I can’t follow your train of thought. What do you want to achieve?

A Subprocess will always start with a blank start event, not an intermediate event. That is defined in the BPMN standard.

If you do not have a Start event, every element without an incoming flow will act as an implicit start. To encourage explicit modeling and reduce confusion, it is recommended to always model the start event.

Yes, I agree that it adds start event by default which is important, but I had doubt for bpmn:IntermediateThrowEvent, can you please brief about this event?