Understanding activity design

Being a new bee in temporal world I was trying to develop a workflow where I have 2 activities and sub tasks as below,

  1. Consume request
    1.1 authenticate request
    1.2 validate and parse
  2. Connect to third-party api and send back final response
    2.1 prepare request
    2.2 sign payload
    2.3 send and get response from thirdparty

To achieve this I can follow any of below approaches,

  1. Create 2 activities for main tasks
  2. Create 5 activities for each sub task

As per the best practice, what are the pros and cons of these 2 approaches?

I was thinking to perform all the tasks (thats part of single logical transaction) to be wrapped in single activity. thats approach 2…is this understanding correct?

1 Like

An activity invocation is a remote procedure call requiring serializing its arguments and results. So, signing payload as a separate activity doesn’t really make sense.

What does consume request mean exactly?