API to run a workflow with custom context?

I am trying to create a new workflow but need the context that was used

If the context is exposed via query method in the completed workflow, you could get it via query (you can query completed workflow executions up to the set namespace retention period) and pass it as input to your new execution.
If it’s not exposed via query handler, you can get the inputs of a workflow execution via api as shown in this forum thread, and then use them to pass to the new execution.