Just doing some testing I found out the Request Data task action is doing it right. It's the only task action that populates the TaskID even before task completion. I tested all task actions and also included action id on the test. Below you can see the results.
|Action ID||Task ID|
|Assign Flexi Task||No||No|
James Tyzack, can you check this out if this is by design? I hope all task actions will populate their task id as soon as the task item is created.