{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/flowra-dev/json-schema/flowra-dev-workflow-response-dto-success-response-schema.json",
  "title": "WorkflowResponseDtoSuccessResponse",
  "x-generated": "2026-11-08",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/flowra-dev-openapi.json#/components/schemas/WorkflowResponseDtoSuccessResponse",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Success status"
    },
    "message": {
      "type": "string",
      "description": "Success message"
    },
    "data": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "projectId": {
          "type": "string"
        },
        "agent": {
          "type": "object",
          "properties": {
            "prompt": {
              "type": "string"
            },
            "modelSettings": {
              "type": "object"
            },
            "capabilities": {
              "type": "object"
            },
            "behavior": {
              "type": "object"
            },
            "identity": {
              "type": "object"
            },
            "skillIds": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "subAgentIds": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "knowledgeCollectionIds": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "databaseCollectionIds": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "databaseAccessPolicies": {
              "type": "object"
            },
            "starterPrompts": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "avatarUrl": {
              "type": "string"
            },
            "tools": {
              "type": "object",
              "properties": {
                "mode": {
                  "enum": [
                    "NORMAL",
                    "META"
                  ],
                  "type": "string"
                },
                "discoveryWhitelist": {
                  "type": "boolean"
                },
                "pinnedSlugs": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "externalMcpConfigs": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "connectionCallbackUrl": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "visitorOwnerConnections": {
                  "$ref": "#/$defs/AgentVisitorOwnerConnectionsResponseDto"
                }
              },
              "required": [
                "mode"
              ]
            },
            "inputSchema": {
              "type": "object"
            },
            "outputSchema": {
              "type": "object"
            }
          },
          "required": [
            "prompt",
            "tools"
          ]
        },
        "graph": {
          "type": "object",
          "properties": {
            "nodes": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "action",
                      "code",
                      "llm_agent",
                      "start",
                      "end",
                      "human_wait"
                    ]
                  },
                  "toolSlug": {
                    "type": "string"
                  },
                  "inputMapping": {
                    "type": "object"
                  },
                  "code": {
                    "type": "string"
                  },
                  "agent": {
                    "$ref": "#/$defs/GraphNodeAgentResponseDto"
                  },
                  "outputSchema": {
                    "type": "object"
                  }
                },
                "required": [
                  "id",
                  "type"
                ]
              }
            },
            "edges": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "from": {
                    "type": "string"
                  },
                  "to": {
                    "type": "string"
                  },
                  "condition": {
                    "type": "string"
                  }
                },
                "required": [
                  "from",
                  "to"
                ]
              }
            },
            "inputSchema": {
              "type": "object"
            },
            "outputSchema": {
              "type": "object"
            }
          },
          "required": [
            "nodes",
            "edges"
          ]
        },
        "provenance": {
          "type": "object",
          "properties": {
            "createdByAgent": {
              "type": "boolean"
            },
            "productCreationDepth": {
              "type": "number"
            },
            "createdFromWorkflowId": {
              "type": "string"
            },
            "hideFromAgentPicker": {
              "type": "boolean"
            },
            "marketplaceClone": {
              "type": "object",
              "properties": {
                "sourceWorkflowId": {
                  "type": "string"
                },
                "clonedAt": {
                  "type": "string"
                },
                "skillIdMap": {
                  "type": "object"
                },
                "knowledgeIdMap": {
                  "type": "object"
                },
                "databaseIdMap": {
                  "type": "object"
                },
                "subAgentIdMap": {
                  "type": "object"
                },
                "avatarFileIdMap": {
                  "type": "object"
                },
                "setupState": {
                  "type": "object",
                  "properties": {
                    "answers": {
                      "type": "object"
                    },
                    "completedStepIds": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "required": [
            "marketplaceClone"
          ]
        },
        "triggers": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "enum": [
                  "manual",
                  "cron",
                  "trigger_tool"
                ]
              },
              "expression": {
                "type": "string"
              },
              "timezone": {
                "type": "string"
              },
              "toolSlug": {
                "type": "string"
              },
              "triggerToolInput": {
                "type": "object"
              },
              "triggerId": {
                "type": "string"
              },
              "toolkitName": {
                "type": "string"
              },
              "toolkitLogo": {
                "type": "string"
              }
            },
            "required": [
              "kind"
            ]
          }
        },
        "workflowType": {
          "type": "string",
          "enum": [
            "static",
            "agent"
          ]
        },
        "isActive": {
          "type": "boolean"
        },
        "lifecycle": {
          "type": "string",
          "enum": [
            "draft",
            "ready"
          ],
          "description": "Completeness lifecycle. draft = incomplete build (cannot activate); ready = may set isActive true."
        },
        "isPublic": {
          "type": "boolean",
          "description": "Whether this workflow (agent) is public for select in other projects"
        },
        "version": {
          "type": "string",
          "description": "Version in form 1.0.x; incremented on each update (for marketplace update check)"
        },
        "clonedFromWorkflowId": {
          "type": [
            "string",
            "null"
          ],
          "description": "If cloned from marketplace: source workflow id"
        },
        "clonedFromVersion": {
          "type": [
            "string",
            "null"
          ],
          "description": "Source workflow version at clone time (e.g. 1.0.1)"
        },
        "executionCount": {
          "type": "number"
        },
        "successfulExecutionCount": {
          "type": "number",
          "description": "Number of executions that finished with status completed"
        },
        "failedExecutionCount": {
          "type": "number",
          "description": "Number of executions that finished with status failed or timeout"
        },
        "lastExecutedAt": {
          "type": "string"
        },
        "connections": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "connectionId": {
                "type": "string"
              },
              "toolkitSlug": {
                "type": "string"
              },
              "displayName": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "User-defined label from connected_accounts.displayName"
              },
              "label": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Human label (displayName, else toolkit name). Never a UUID."
              },
              "createdAt": {
                "type": "string"
              },
              "updatedAt": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "connectionId",
              "toolkitSlug",
              "createdAt",
              "updatedAt"
            ]
          }
        },
        "tools": {
          "description": "Pinned tools from workflow_tools join (enriched).",
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "toolSlug": {
                "type": "string"
              },
              "toolName": {
                "type": "string"
              },
              "toolkitName": {
                "type": "string"
              },
              "toolkitLogo": {
                "type": "string"
              }
            },
            "required": [
              "toolSlug",
              "toolName",
              "toolkitName"
            ]
          }
        },
        "subAgents": {
          "description": "Resolved child specialists (hidden from the agent list).",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "createdAt": {
          "format": "date-time",
          "type": "string"
        },
        "updatedAt": {
          "format": "date-time",
          "type": "string"
        },
        "sourceVersionLatest": {
          "type": "string",
          "description": "When workflow is cloned from marketplace: latest version of source (for \"update available\" UI)."
        },
        "toolkitAuthConfigs": {
          "description": "Agent-only: toolkitSlug → AuthConfig bindings.",
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "toolkitSlug": {
                "type": "string"
              },
              "authConfigId": {
                "type": "string"
              },
              "name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "authScheme": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "status": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "toolkitSlug",
              "authConfigId"
            ]
          }
        },
        "toolkitConnections": {
          "description": "Static + cron agents: preferred ConnectedAccount binds (chat/trigger do not use these).",
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "toolkitSlug": {
                "type": "string"
              },
              "connectedAccountId": {
                "type": "string"
              },
              "displayName": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "label": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Human label (displayName or provider identity). Never a UUID."
              },
              "status": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "authConfigId": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "toolkitSlug",
              "connectedAccountId"
            ]
          }
        },
        "marketplaceCategory": {
          "type": [
            "string",
            "null"
          ],
          "description": "Marketplace listing category"
        },
        "marketplaceAudience": {
          "type": [
            "string",
            "null"
          ],
          "description": "Marketplace audience: for_you | for_your_users | both"
        },
        "marketplaceTagline": {
          "type": [
            "string",
            "null"
          ]
        },
        "marketplaceSetupGuide": {
          "type": [
            "string",
            "null"
          ]
        },
        "marketplaceSetupSpec": {
          "type": [
            "object",
            "null"
          ]
        },
        "marketplaceSetupSkillId": {
          "type": [
            "string",
            "null"
          ]
        },
        "marketplaceSetupSkillSlug": {
          "type": [
            "string",
            "null"
          ]
        },
        "marketplaceHighlights": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "string"
          }
        },
        "marketplaceIsListed": {
          "type": "boolean",
          "description": "When false, listing is hidden from the public catalog"
        },
        "marketplaceCapabilities": {
          "type": "object",
          "properties": {
            "hasSkills": {
              "type": "boolean"
            },
            "skillCount": {
              "type": "number"
            },
            "hasKnowledge": {
              "type": "boolean"
            },
            "hasDatabase": {
              "type": "boolean"
            },
            "hasCron": {
              "type": "boolean"
            },
            "requiresAuth": {
              "type": "boolean"
            },
            "toolkitCount": {
              "type": "number"
            },
            "subAgentCount": {
              "type": "number"
            },
            "toolCount": {
              "type": "number"
            }
          }
        }
      },
      "required": [
        "id",
        "name",
        "projectId",
        "triggers",
        "workflowType",
        "isActive",
        "lifecycle",
        "isPublic",
        "version",
        "executionCount",
        "successfulExecutionCount",
        "failedExecutionCount",
        "connections",
        "tools",
        "createdAt",
        "updatedAt",
        "marketplaceCapabilities"
      ]
    }
  },
  "required": [
    "success",
    "message",
    "data"
  ],
  "$defs": {
    "AgentVisitorOwnerConnectionsResponseDto": {
      "type": "object",
      "properties": {
        "enabled": {
          "type": "boolean"
        },
        "toolkits": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AgentVisitorOwnerToolkitGrantResponseDto"
          }
        }
      },
      "required": [
        "enabled",
        "toolkits"
      ]
    },
    "AgentVisitorOwnerToolkitGrantResponseDto": {
      "type": "object",
      "properties": {
        "toolkitSlug": {
          "type": "string"
        },
        "toolSlugs": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "toolkitSlug"
      ]
    },
    "GraphNodeAgentResponseDto": {
      "type": "object",
      "properties": {
        "prompt": {
          "type": "string"
        },
        "modelSettings": {
          "type": "object"
        },
        "toolSlugs": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "knowledgeCollectionIds": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "databaseCollectionIds": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "databaseAccessPolicies": {
          "type": "object"
        }
      },
      "required": [
        "prompt"
      ]
    }
  }
}