curl --request GET \
--url http://127.0.0.1:8189/api/v2/jobs/{id}/workflow \
--header 'Authorization: Bearer <token>'import requests
url = "http://127.0.0.1:8189/api/v2/jobs/{id}/workflow"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('http://127.0.0.1:8189/api/v2/jobs/{id}/workflow', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8189",
CURLOPT_URL => "http://127.0.0.1:8189/api/v2/jobs/{id}/workflow",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://127.0.0.1:8189/api/v2/jobs/{id}/workflow"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("http://127.0.0.1:8189/api/v2/jobs/{id}/workflow")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("http://127.0.0.1:8189/api/v2/jobs/{id}/workflow")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"workflow": {},
"format": "save"
}{
"error": {
"code": "invalid_workflow",
"message": "Node 12 (KSampler): required input 'model' is not connected",
"details": {
"node_errors": {
"12": [
{
"field": "model",
"reason": "missing_input"
}
]
}
}
}
}{
"error": {
"code": "invalid_workflow",
"message": "Node 12 (KSampler): required input 'model' is not connected",
"details": {
"node_errors": {
"12": [
{
"field": "model",
"reason": "missing_input"
}
]
}
}
}
}{
"error": {
"code": "invalid_workflow",
"message": "Node 12 (KSampler): required input 'model' is not connected",
"details": {
"node_errors": {
"12": [
{
"field": "model",
"reason": "missing_input"
}
]
}
}
}
}{
"error": {
"code": "invalid_workflow",
"message": "Node 12 (KSampler): required input 'model' is not connected",
"details": {
"node_errors": {
"12": [
{
"field": "model",
"reason": "missing_input"
}
]
}
}
}
}{
"error": {
"code": "invalid_workflow",
"message": "Node 12 (KSampler): required input 'model' is not connected",
"details": {
"node_errors": {
"12": [
{
"field": "model",
"reason": "missing_input"
}
]
}
}
}
}The workflow behind a job — authoring version if pinned, executed graph otherwise
Returns the workflow behind a job. The response’s format field says
which of two different shapes workflow is in:
format: save— the original authoring workflow exactly as saved in the Comfy Cloud editor at the version the job ran, including canvas layout and frontend-only nodes (e.g. Note nodes; Get/Set nodes not yet expanded). Returned only when the job is pinned to a specific workflow version — see the “when you get which” note below.format: api— the executed API-format prompt graph the job actually ran: frontend-only constructs are gone and Get/Set nodes are expanded. This is the same shapePOST /api/v2/jobs’sworkflowrequest field takes, and never includes the submission’sextra_data, which can carry a live credential.
Always branch on format, never assume one or the other — which
shape comes back depends on how the job was submitted, not on
anything the caller controls per-request.
A deliberate sub-resource, not a field on GET /api/v2/jobs/{id} —
so the polling workhorse stays cheap and a caller pays for this only
when it actually wants the workflow (for example, to recover what
produced a given output).
Tied to the job’s own retention: this 404s under the same conditions
GET /api/v2/jobs/{id} does (unknown, not-yours, or past its
retention deadline) — there is no separate lifetime for the
workflow.
When you get which: a job only carries a pinned workflow version
when it was submitted with that association. Today that means jobs
submitted from the Comfy Cloud frontend/editor. Jobs submitted
directly through this v2 API (POST /api/v2/jobs) do not carry that
association — v2 job submission has no version-linking fields yet —
so they always get format: api. This is expected, not a bug: it
will change once v2 submission grows the same version pinning.
A job pinned to a version also falls back to format: api if that
version, or the workflow it belongs to, is no longer readable by the
caller — for example the caller deleted the workflow since the job
ran. This is the same fallback as an unpinned job, and for the same
reason: it is preferable to the alternative of erroring the whole
request over data that is genuinely gone.
curl --request GET \
--url http://127.0.0.1:8189/api/v2/jobs/{id}/workflow \
--header 'Authorization: Bearer <token>'import requests
url = "http://127.0.0.1:8189/api/v2/jobs/{id}/workflow"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('http://127.0.0.1:8189/api/v2/jobs/{id}/workflow', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8189",
CURLOPT_URL => "http://127.0.0.1:8189/api/v2/jobs/{id}/workflow",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://127.0.0.1:8189/api/v2/jobs/{id}/workflow"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("http://127.0.0.1:8189/api/v2/jobs/{id}/workflow")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("http://127.0.0.1:8189/api/v2/jobs/{id}/workflow")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"workflow": {},
"format": "save"
}{
"error": {
"code": "invalid_workflow",
"message": "Node 12 (KSampler): required input 'model' is not connected",
"details": {
"node_errors": {
"12": [
{
"field": "model",
"reason": "missing_input"
}
]
}
}
}
}{
"error": {
"code": "invalid_workflow",
"message": "Node 12 (KSampler): required input 'model' is not connected",
"details": {
"node_errors": {
"12": [
{
"field": "model",
"reason": "missing_input"
}
]
}
}
}
}{
"error": {
"code": "invalid_workflow",
"message": "Node 12 (KSampler): required input 'model' is not connected",
"details": {
"node_errors": {
"12": [
{
"field": "model",
"reason": "missing_input"
}
]
}
}
}
}{
"error": {
"code": "invalid_workflow",
"message": "Node 12 (KSampler): required input 'model' is not connected",
"details": {
"node_errors": {
"12": [
{
"field": "model",
"reason": "missing_input"
}
]
}
}
}
}{
"error": {
"code": "invalid_workflow",
"message": "Node 12 (KSampler): required input 'model' is not connected",
"details": {
"node_errors": {
"12": [
{
"field": "model",
"reason": "missing_input"
}
]
}
}
}
}承認
Authorization: Bearer <api-key> — account-scoped API keys on Cloud and serverless. Self-hosted accepts unauthenticated requests by default and can be configured with a static bearer token.
パスパラメータ
レスポンス
The workflow graph.
The workflow behind a job. See GET /api/v2/jobs/{id}/workflow's description for exactly when format is save vs api.