How are tasks counted in ActivePieces?

Hi everyone,

I’m a bit confused about how tasks are counted.

  1. What is the exact definition of a “task” in ActivePieces?
  2. If I have a flow with 10 steps, does each step count as a separate task?
  3. Are code blocks considered tasks themselves?
  4. Does a trigger consume one task per run?
  5. How can I estimate the number of tasks used in a flow?

For example, let’s say I have a flow that retrieves data from an API, processes it, and then sends an email notification. Would this count as 3 tasks (one for each operation) or more?

Any insights would be greatly appreciated!

Thanks

Hi @IOBLR Sorry that this confused you. We keep the definition of tasks on Activepieces so simple, that’s why our pricing/offers are very generous when it comes to tasks (instead of complicating the definition of tasks).

When you create a flow, the trigger is responsible for starting the flow every time it runs. Whenever it runs, any executed “step” in your flow will count towards your tasks.

So if you have a flow of 10 steps (including the trigger), but only 5 of them executed (for example if you have a branch so only one side executed), this will consume 5 tasks.

If your flow is linear (no branches, no loops) and it has 10 steps, every time it runs, it will consume 10 tasks.

Does this make sense to you?

3 Likes

Yes this makes sense to me and answered all my questions.
Thank you @ashrafsam

2 Likes

What happens if you have a loop? So for example the task is to loop through and email each address listed. If there are 10 email addresses, will that count as 10 additional taks (1 for each email sent to an address)?

@edub Yes, based on what @ashrafsam mentioned every time a step is executed, It is counted as a task.

In your case, If you’re looping over 10 items, then 10 steps are being executed and hence it consumes 10 tasks.

1 Like

So, it’s better to use Code peace for loops, AI helps a lot with coding.

1 Like

We definitely can and should optimize our flows but code is just one of the pieces, If you use code block to run the loops, how will you call the other pieces like OpenAI? or image generator? - via HTTP? then you don’t even need ActivePieces, everything can be done in the code.

If you need to run the loop and you’re not calling any other pieces then code block is definitely the best option.

then you don’t even need ActivePieces, everything can be done in the code

Yes, it’s true, but you don’t need to pay attention to infrastructure, administration and so on. That’s why I like such kinds of services :slight_smile:

1 Like

You’re right, That’s one the reason I use ActivePieces myself.