This is an older question, so I don’t know whether you have been able to find a satisfactory answer.
Referring to the example from the ortools documentation you used, just add the cumulative constraint while keeping everything else the same (as each and any of the other constraints are still valid):
capacity = 2 # Maximum capacity of 2 machines in use at any time
model.add_cumulative(
[all_tasks[job_id, task_id].interval for job_id, job in enumerate(jobs_data) for task_id, task in enumerate(job)],
[1] * len(all_tasks), # Demand of 1 for every interval
capacity
)
… basically, CP-SAT syntax of what Sascha explained