A computer implemented method for determining a configuration of a medical robotic arm, wherein the configuration comprises a pose of the robotic arm and a position of a base of the robotic arm, comprising the steps of:- acquiring changed environment data including information about the beginning of a new workflow step of a workflow which uses the robotic arm, wherein each workflow step has associated therewith workflow step constraint information data representing at least one of positions of people involved in a treatment, information about equipment used in the workflow step and tasks to be performed in the workflow step;- transforming workflow step constraint information data associated with the new workflow step into spatial constraint data representing spatial constraints for the configuration of the robotic arm in terms of a plurality of areas in space into which the robotic arm should not enter;- calculating an overall spatial area from the plurality of areas; and- calculating the configuration of the robotic arm based on the overall spatial area.