Each node in our backend has a cost associated with it that we defined on a 0-100 scale. Our plan is to aggregate those at the end of a run to determine it's cost. Tying that cost to some actual metric like CPU usage could be a great idea though.
Runs are basically dynamically generated scripts. Our backend parses the automation definition from the DAG on the frontend, fetches the definitions of each node and stitches it all together to run in a sandbox env. It started off quite simple in the early days but it's become quite an monstrous system with dynamic variables, nesting, looping, credential access and error handling.