Workflow_id under ActivityClient
Hi AWS Flow Team,
Is it possible to access the workflow_id (without passing it as a variable) into the activity itself? We can display it in our workflow everywhere but for the activities it needs to be passed every single time as a variable from the workflow for it to be accessible. On a similar note, is it possible to 'initialise' certain variables (defined during start workflow execution as input) under the activities so they remain accessible throughout the entire workflow without passing them in as well.
Thanks in advance!
(Note that I'm no longer associated with Amazon, so my thoughts aren't the end-all on this matter)
The reason why it was made a little obtuse to pass the workflow_id without passing it as a variable was to prevent people accidentally breaking the determinism constraint. The worry was that if people make decisions based off the workflow_id, but it's not passed in to the activity as an argument, it would have to be from some other source, which may well break the necessary determinism.
If the domain of possible input variables is small, it might be best to initiate different activities based on input, which would reduce the input to the activities while maintaining determinism/ability to run activities on different machines. Otherwise, I think the best way to go about it is to pass them as input. If you have any suggestions on how else to initialize activities based on workflow input, I'd be happy to hear it!