Working with the API
Workflow runs, credits and results
Estimate a workflow’s credit cost before you start it. Poll the run by ID to check its status, then look up the results by node in the space.
How much will a workflow run cost?
An estimate says what a run would make and what it would cost in credits. It starts nothing and spends nothing. Say what to run: all for the whole space, nodes with their IDs, or group with a group’s ID.
curl -H "Authorization: Bearer $HYPERMAKE_KEY" -H "Content-Type: application/json" -d '{"kind":"all"}' \
"https://b1key7cfde.execute-api.eu-north-1.amazonaws.com/v1/organizations/$HYPERMAKE_ORG/spaces/$SPACE/runs/estimate"Start a run with a credit budget
Start the run with the same target, an ID you make and the credits you approve. When the price has grown past what you approved, nothing starts: the answer is 409 and carries the new estimate, so you can agree to it and send the request again.
curl -H "Authorization: Bearer $HYPERMAKE_KEY" -H "Content-Type: application/json" \
-d '{"id":"run_01jd…","target":{"kind":"all"},"approvedCredits":12}' \
"https://b1key7cfde.execute-api.eu-north-1.amazonaws.com/v1/organizations/$HYPERMAKE_ORG/spaces/$SPACE/runs"How do I check a run’s status?
Poll GET /spaces/{space}/runs/{run} every few seconds. Stop polling when the status is succeeded, failed or cancelled.
| Status | What it means |
|---|---|
| running | Something of the run is being made or is about to be. |
| paused | It waits: for credits, or for a higher approval than it was started with. |
| succeeded | Everything was made. |
| failed | Something could not be made. Each job says why. |
| cancelled | It was stopped. What was already being made finished and was paid for. |
curl -H "Authorization: Bearer $HYPERMAKE_KEY" "https://b1key7cfde.execute-api.eu-north-1.amazonaws.com/v1/organizations/$HYPERMAKE_ORG/spaces/$SPACE/runs/$RUN"Retrieve results for a node
List results for the space, newest first. Use the node query parameter to narrow the results to one node. For a file result, look up its fileId in the Library to get the download link.
curl -H "Authorization: Bearer $HYPERMAKE_KEY" "https://b1key7cfde.execute-api.eu-north-1.amazonaws.com/v1/organizations/$HYPERMAKE_ORG/spaces/$SPACE/results?node=$NODE"Cancel a run
Cancelling stops what a run has not started yet. What is already being made finishes and is paid for.
curl -H "Authorization: Bearer $HYPERMAKE_KEY" -X POST "https://b1key7cfde.execute-api.eu-north-1.amazonaws.com/v1/organizations/$HYPERMAKE_ORG/spaces/$SPACE/runs/$RUN/cancel"