{ "openapi": "3.0.0", "info": { "title": "quiva.ai Gateway", "description": "API for managing collections, nodes, and workflows in quiva.ai Hub", "version": "0.1.0", "contact": { "name": "quiva.ai Support" } }, "servers": [ { "url": "https://api.quiva.ai", "description": "Production API server" } ], "paths": { "/hub/collections": { "post": { "tags": [ "Collections" ], "summary": "Create a new collection", "description": "Creates a new collection for organizing nodes or workflows", "operationId": "createCollection", "x-resource-type": "service", "x-resource": "microstrate.hub.post.collection", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateCollectionRequest" }, "examples": { "NodeCollection": { "summary": "Create a node collection", "value": { "name": "Payment Processing Nodes", "collection_type": "node", "description": "Collection of reusable payment processing node templates" } }, "WorkflowCollection": { "summary": "Create a workflow collection", "value": { "name": "Order Management Flows", "collection_type": "workflow", "description": "Workflows for handling order lifecycle" } }, "MinimalCollection": { "summary": "Create collection with minimal fields", "value": { "name": "Utilities", "collection_type": "node" } } } } } }, "responses": { "201": { "description": "Collection created successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateCollectionResponse" }, "examples": { "NodeCollectionCreated": { "summary": "Node collection created", "value": { "subject": "ms.hub.config.collection.node.805092869", "name": "Payment Processing Nodes", "collection_type": "node", "topic": "805092869", "description": "Collection of reusable payment processing node templates", "modified": 1748533179 } }, "WorkflowCollectionCreated": { "summary": "Workflow collection created", "value": { "subject": "ms.hub.config.collection.workflow.1508781670", "name": "Order Management Flows", "collection_type": "workflow", "topic": "1508781670", "description": "Workflows for handling order lifecycle", "modified": 1748533200 } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" }, "examples": { "NameRequired": { "value": { "error": "a name is required" } }, "InvalidType": { "value": { "error": "invalid collection type. Valid types are: node, workflow" } } } } } }, "409": { "description": "Collection already exists", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" }, "example": { "error": "collection exists:ms.hub.config.collection.node.1234567890" } } } } } }, "get": { "tags": [ "Collections" ], "summary": "List collections", "description": "Retrieves a list of collections", "operationId": "getCollection", "x-resource-type": "service", "x-resource": "microstrate.hub.get.list-collections", "parameters": [ { "$ref": "#/components/parameters/queryCollectionType" } ], "responses": { "200": { "description": "Collection retrieved successfully", "content": { "application/json": { "schema": { "type": "object", "required": [ "results", "results_total" ], "properties": { "results": { "type": "object", "properties": { "results": { "type": "array", "description": "Array of results", "items": { "$ref": "#/components/schemas/GetCollectionResponse" } }, "results_total": { "type": "integer", "description": "Number of results" } } } } }, "examples": { "AllCollections": { "summary": "List all collections (no filter)", "value": { "results_total": 4, "results": [ { "collection_type": "node", "description": "Payment processing node templates", "modified": 1748533179, "name": "Payment Nodes", "sequence": 16, "subject": "ms.hub.config.collection.node.805092869", "topic": "805092869", "type": "created" }, { "collection_type": "node", "description": "Utility functions for data transformation", "modified": 1748533200, "name": "Data Transform Nodes", "sequence": 24, "subject": "ms.hub.config.collection.node.1025086208", "topic": "1025086208", "type": "updated" }, { "collection_type": "workflow", "description": "Order lifecycle management", "modified": 1748533250, "name": "Order Flows", "sequence": 31, "subject": "ms.hub.config.collection.workflow.1508781670", "topic": "1508781670", "type": "created" }, { "collection_type": "workflow", "description": "", "modified": 1748533300, "name": "Notification Flows", "sequence": 45, "subject": "ms.hub.config.collection.workflow.2098761234", "topic": "2098761234", "type": "created" } ] } }, "NodeCollectionsOnly": { "summary": "List node collections only", "value": { "results_total": 2, "results": [ { "collection_type": "node", "description": "Payment processing node templates", "modified": 1748533179, "name": "Payment Nodes", "sequence": 16, "subject": "ms.hub.config.collection.node.805092869", "topic": "805092869", "type": "created" }, { "collection_type": "node", "description": "Utility functions for data transformation", "modified": 1748533200, "name": "Data Transform Nodes", "sequence": 24, "subject": "ms.hub.config.collection.node.1025086208", "topic": "1025086208", "type": "updated" } ] } }, "WorkflowCollectionsOnly": { "summary": "List workflow collections only", "value": { "results_total": 2, "results": [ { "collection_type": "workflow", "description": "Order lifecycle management", "modified": 1748533250, "name": "Order Flows", "sequence": 31, "subject": "ms.hub.config.collection.workflow.1508781670", "topic": "1508781670", "type": "created" }, { "collection_type": "workflow", "description": "", "modified": 1748533300, "name": "Notification Flows", "sequence": 45, "subject": "ms.hub.config.collection.workflow.2098761234", "topic": "2098761234", "type": "created" } ] } }, "EmptyResult": { "summary": "No collections found", "value": { "results_total": 0, "results": [] } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" }, "examples": { "InvalidSubject": { "value": { "error": "invalid subject" } } } } } } } } }, "/hub/collections/{collection_type}/{collection_topic}": { "parameters": [ { "$ref": "#/components/parameters/collectionType" }, { "$ref": "#/components/parameters/collectionTopic" } ], "get": { "tags": [ "Collections" ], "summary": "Get a collection", "description": "Retrieves a specific collection", "operationId": "getCollection", "x-resource-type": "service", "x-resource": "microstrate.hub.get.collection", "responses": { "200": { "description": "Collection retrieved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetCollectionResponse" }, "examples": { "NodeCollection": { "summary": "Retrieved node collection", "value": { "collection_type": "node", "description": "Payment processing node templates", "modified": 1748533179, "name": "Payment Nodes", "sequence": 16, "subject": "ms.hub.config.collection.node.805092869", "topic": "805092869", "type": "created" } }, "WorkflowCollection": { "summary": "Retrieved workflow collection", "value": { "collection_type": "workflow", "description": "Order lifecycle management workflows", "modified": 1748533250, "name": "Order Flows", "sequence": 124, "subject": "ms.hub.config.collection.workflow.1508781670", "topic": "1508781670", "type": "updated" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" }, "examples": { "InvalidSubject": { "value": { "error": "invalid subject" } } } } } } } }, "patch": { "tags": [ "Collections" ], "summary": "Update a Workflow or Node collection", "description": "Updates an existing collection's properties", "operationId": "updateFlowOrNodeCollection", "x-resource-type": "service", "x-resource": "microstrate.hub.patch.collection", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateCollectionRequest" }, "examples": { "UpdateDescription": { "summary": "Update collection description", "value": { "subject": "ms.hub.config.collection.node.805092869", "description": "Updated: Payment and billing node templates for all transaction types" } }, "ClearDescription": { "summary": "Clear collection description", "value": { "subject": "ms.hub.config.collection.workflow.1508781670", "description": "" } } } } } }, "responses": { "200": { "description": "Collection updated successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SuccessResponse" }, "example": { "message": "success" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" }, "examples": { "SubjectRequired": { "value": { "error": "a subject is required" } } } } } }, "404": { "description": "Collection not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" }, "example": { "error": "collection does not exists" } } } } } }, "delete": { "tags": [ "Collections" ], "summary": "Delete a collection", "description": "Deletes a specific collection by subject", "operationId": "deleteCollection", "x-resource-type": "service", "x-resource": "microstrate.hub.delete.collection", "parameters": [ { "name": "move_resources_to_collection", "in": "query", "description": "A topic of another collection where resources can be moved", "required": true, "schema": { "type": "string" }, "example": "993267890" } ], "responses": { "200": { "description": "Collection deleted successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SuccessResponse" }, "example": { "message": "success" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" }, "examples": { "InvalidSubject": { "value": { "error": "invalid subject" } } } } } }, "404": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" }, "examples": { "CollectionNotFount": { "value": { "error": "collection not found" } }, "NewResourceCollectionNotFount": { "value": { "error": "the new resource collection is not found" } } } } } } } } }, "/hub/nodes": { "post": { "tags": [ "Nodes" ], "summary": "Create a new node", "description": "Creates a new node template within a collection", "operationId": "createNode", "x-resource-type": "service", "x-resource": "microstrate.hub.post.node", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateNodeRequest" }, "examples": { "FunctionNode": { "summary": "Create a function node", "value": { "collection": "ms.hub.config.collection.node.805092869", "data": { "name": "ProcessPayment", "description": "Processes a payment transaction via Stripe", "node_type": "function", "subject": "quiva-function.stripe-charge", "payload": { "amount": "{{trigger.amount}}", "currency": "{{trigger.currency}}", "customer_id": "{{trigger.customer_id}}" }, "options": { "timeout": 30000, "attempts": 3, "backoff_ms": 1000 } } } }, "MapNode": { "summary": "Create a map/transformation node", "value": { "collection": "ms.hub.config.collection.node.1025086208", "data": { "name": "TransformOrderData", "description": "Transforms order data for downstream processing", "node_type": "map", "payload": { "order_id": "{{trigger.id}}", "total_amount": "{{trigger.items | sum('price')}}", "customer": { "email": "{{trigger.customer.email}}", "name": "{{trigger.customer.full_name}}" } } } } }, "ConditionNode": { "summary": "Create a condition/branching node", "value": { "collection": "ms.hub.config.collection.node.805092869", "data": { "name": "CheckOrderAmount", "description": "Routes high-value orders to priority processing", "node_type": "condition", "payload": { "condition": "{{trigger.total > 1000}}", "true_branch": "priority_handler", "false_branch": "standard_handler" } } } }, "EvalNode": { "summary": "Create an eval node for calculations", "value": { "collection": "ms.hub.config.collection.node.1025086208", "data": { "name": "CalculateDiscount", "description": "Calculates discount based on order value", "node_type": "eval", "payload": { "code": "const total = trigger.total; return total > 500 ? total * 0.1 : total * 0.05;" } } } }, "FlowNode": { "summary": "Create a flow invocation node", "value": { "collection": "ms.hub.config.collection.node.805092869", "data": { "name": "SendNotification", "description": "Invokes the notification workflow", "node_type": "flow", "subject": "ms.hub.config.workflow.1508781670.notification-flow", "payload": { "recipient": "{{trigger.customer.email}}", "template": "order_confirmation", "data": "{{trigger}}" }, "await": false } } }, "IntegrationNode": { "summary": "Create an integration node", "value": { "collection": "ms.hub.config.collection.node.805092869", "data": { "name": "SlackNotify", "description": "Sends notification to Slack channel", "node_type": "integration", "subject": "integration.slack.post-message", "payload": { "channel": "#orders", "message": "New order received: {{trigger.order_id}}" } } } } } } } }, "responses": { "201": { "description": "Node created successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateNodeResponse" }, "examples": { "FunctionNodeCreated": { "summary": "Function node created", "value": { "subject": "ms.hub.config.node.805092869.98765432", "collection": "ms.hub.config.collection.node.805092869", "data": { "id": "98765432", "name": "ProcessPayment", "description": "Processes a payment transaction via Stripe", "node_type": "function", "subject": "quiva-function.stripe-charge", "payload": { "amount": "{{trigger.amount}}", "currency": "{{trigger.currency}}", "customer_id": "{{trigger.customer_id}}" }, "options": { "timeout": 30000, "attempts": 3, "backoff_ms": 1000 } }, "type": "created", "modified": 1748533179 } }, "MapNodeCreated": { "summary": "Map node created", "value": { "subject": "ms.hub.config.node.1025086208.12345678", "collection": "ms.hub.config.collection.node.1025086208", "data": { "id": "12345678", "name": "TransformOrderData", "description": "Transforms order data for downstream processing", "node_type": "map", "payload": { "order_id": "{{trigger.id}}", "total_amount": "{{trigger.items | sum('price')}}" } }, "type": "created", "modified": 1748533200 } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" }, "examples": { "NameRequired": { "value": { "error": "data.name is required" } }, "CollectionRequired": { "value": { "error": "a collection subject is required" } }, "InvalidCollection": { "value": { "error": "invalid collection subject" } }, "PayloadRequired": { "value": { "error": "payload is required" } }, "FunctionSubjectRequired": { "value": { "error": "a function subject is required" } } } } } }, "404": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" }, "examples": { "CollectionNotFound": { "value": { "error": "collection not found" } }, "FunctionNotFound": { "value": { "error": "function not found" } } } } } }, "409": { "description": "Node already exists", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" }, "example": { "error": "node exists:ms.hub.config.node.1234567890.98765432" } } } } } }, "get": { "tags": [ "Nodes" ], "summary": "List node templates", "description": "Retrieves a list of node templates, optionally filtered by collection and type", "operationId": "listNodeTemplates", "x-resource-type": "service", "x-resource": "microstrate.hub.get.list-nodes", "parameters": [ { "$ref": "#/components/parameters/collectionTopic" } ], "responses": { "200": { "description": "Nodes retrieved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListNodesResponse" }, "examples": { "AllNodes": { "summary": "List all nodes", "value": { "results_total": 3, "results": [ { "subject": "ms.hub.config.node.805092869.98765432", "collection": "ms.hub.config.collection.node.805092869", "data": { "id": "98765432", "name": "ProcessPayment", "description": "Processes payment via Stripe", "node_type": "function", "subject": "quiva-function.stripe-charge", "payload": { "amount": "{{trigger.amount}}" } }, "type": "created", "modified": 1748533179 }, { "subject": "ms.hub.config.node.805092869.11223344", "collection": "ms.hub.config.collection.node.805092869", "data": { "id": "11223344", "name": "ValidateCard", "node_type": "function", "subject": "quiva-function.card-validator", "payload": { "card_number": "{{trigger.card}}" } }, "type": "updated", "modified": 1748533200 }, { "subject": "ms.hub.config.node.1025086208.55667788", "collection": "ms.hub.config.collection.node.1025086208", "data": { "id": "55667788", "name": "TransformData", "node_type": "map", "payload": { "output": "{{trigger.input | uppercase}}" } }, "type": "created", "modified": 1748533250 } ] } }, "FilteredByCollection": { "summary": "Nodes filtered by collection", "value": { "results_total": 2, "results": [ { "subject": "ms.hub.config.node.805092869.98765432", "collection": "ms.hub.config.collection.node.805092869", "data": { "id": "98765432", "name": "ProcessPayment", "node_type": "function", "subject": "quiva-function.stripe-charge" }, "type": "created", "modified": 1748533179 }, { "subject": "ms.hub.config.node.805092869.11223344", "collection": "ms.hub.config.collection.node.805092869", "data": { "id": "11223344", "name": "ValidateCard", "node_type": "function", "subject": "quiva-function.card-validator" }, "type": "updated", "modified": 1748533200 } ] } }, "EmptyResult": { "summary": "No nodes found", "value": { "results_total": 0, "results": [] } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" }, "example": { "error": "invalid request" } } } } } } }, "/hub/nodes/{collection_topic}/{node_topic}": { "parameters": [ { "$ref": "#/components/parameters/collectionTopic" }, { "$ref": "#/components/parameters/nodeTopic" } ], "get": { "tags": [ "Nodes" ], "summary": "Get a node", "description": "Retrieves a specific node by subject", "operationId": "getNode", "x-resource-type": "service", "x-resource": "microstrate.hub.get.node", "responses": { "200": { "description": "Node retrieved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetNodeResponse" }, "examples": { "FunctionNode": { "summary": "Retrieved function node", "value": { "subject": "ms.hub.config.node.805092869.98765432", "data": { "id": "98765432", "name": "ProcessPayment", "description": "Processes a payment transaction via Stripe", "node_type": "function", "subject": "quiva-function.stripe-charge", "payload": { "amount": "{{trigger.amount}}", "currency": "{{trigger.currency}}", "customer_id": "{{trigger.customer_id}}" }, "options": { "timeout": 30000, "attempts": 3, "backoff_ms": 1000, "ignore_response_codes": [ 404, 429 ] } }, "modified": 1748533179 } }, "MapNode": { "summary": "Retrieved map node", "value": { "subject": "ms.hub.config.node.1025086208.55667788", "data": { "id": "55667788", "name": "TransformOrderData", "description": "Transforms order data structure", "node_type": "map", "payload": { "order_id": "{{trigger.id}}", "total": "{{trigger.items | sum('price')}}", "customer_email": "{{trigger.customer.email}}" }, "response_map": { "processed_order": "{{result}}" } }, "modified": 1748533200 } }, "ConditionNode": { "summary": "Retrieved condition node", "value": { "subject": "ms.hub.config.node.805092869.33445566", "data": { "id": "33445566", "name": "CheckOrderValue", "description": "Routes orders based on value threshold", "node_type": "condition", "payload": { "condition": "{{trigger.total > 1000}}" } }, "modified": 1748533250 } }, "FlowNode": { "summary": "Retrieved flow invocation node", "value": { "subject": "ms.hub.config.node.805092869.77889900", "data": { "id": "77889900", "name": "TriggerNotificationFlow", "description": "Invokes notification workflow asynchronously", "node_type": "flow", "subject": "ms.hub.config.workflow.1508781670.notify", "payload": { "recipient": "{{trigger.email}}", "message": "{{trigger.message}}" }, "await": false, "options": { "timeout": 60000 } }, "modified": 1748533300 } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" }, "examples": { "InvalidSubject": { "value": { "error": "invalid subject" } } } } } } } }, "patch": { "tags": [ "Nodes" ], "summary": "Update a node", "description": "Updates an existing node's properties", "operationId": "updateNode", "x-resource-type": "service", "x-resource": "microstrate.hub.patch.node", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateNodeRequest" }, "examples": { "UpdatePayload": { "summary": "Update node payload", "value": { "subject": "ms.hub.config.node.805092869.98765432", "data": { "name": "ProcessPayment", "node_type": "function", "subject": "quiva-function.stripe-charge", "payload": { "amount": "{{trigger.amount}}", "currency": "{{trigger.currency}}", "customer_id": "{{trigger.customer_id}}", "metadata": { "order_id": "{{trigger.order_id}}" } } } } }, "UpdateOptions": { "summary": "Update node options", "value": { "subject": "ms.hub.config.node.805092869.98765432", "data": { "name": "ProcessPayment", "node_type": "function", "subject": "quiva-function.stripe-charge", "payload": { "amount": "{{trigger.amount}}" }, "options": { "timeout": 60000, "attempts": 5, "backoff_ms": 2000, "ignore_response_codes": [ 404, 429, 503 ] } } } }, "UpdateDescription": { "summary": "Update node description", "value": { "subject": "ms.hub.config.node.1025086208.55667788", "data": { "name": "TransformOrderData", "description": "Updated: Transforms and enriches order data for analytics", "node_type": "map", "payload": { "order_id": "{{trigger.id}}" } } } }, "ArchiveNode": { "summary": "Archive a node", "value": { "subject": "ms.hub.config.node.805092869.11223344", "data": { "name": "DeprecatedValidator", "node_type": "function", "subject": "quiva-function.old-validator" }, "archived": true } } } } } }, "responses": { "200": { "description": "Node updated successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SuccessResponse" }, "example": { "message": "success" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" }, "examples": { "SubjectRequired": { "value": { "error": "a subject is required" } }, "FunctionNotFound": { "value": { "error": "function not found" } } } } } }, "404": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" }, "examples": { "FlowNotFound": { "value": { "error": "flow not found" } } } } } } } }, "delete": { "tags": [ "Nodes" ], "summary": "Delete a node", "description": "Deletes a specific node by subject", "operationId": "deleteNode", "x-resource-type": "service", "x-resource": "microstrate.hub.delete.node", "responses": { "200": { "description": "Node deleted successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SuccessResponse" }, "example": { "message": "success" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" }, "examples": { "InvalidSubject": { "value": { "error": "invalid subject" } } } } } } } } }, "/hub/nodes/batch": { "patch": { "tags": [ "Nodes" ], "summary": "Update multiple nodes", "description": "Updates multiple existing nodes in a single request", "operationId": "updateMultipleNodes", "x-resource-type": "service", "x-resource": "microstrate.hub.patch.nodes", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateMultiNodeRequest" }, "examples": { "UpdateMultipleFunctionNodes": { "summary": "Update multiple function nodes", "value": [ { "subject": "ms.hub.config.node.805092869.98765432", "data": { "name": "ProcessPaymentV2", "node_type": "function", "subject": "quiva-function.stripe-charge-v2", "payload": { "amount": "{{trigger.amount}}", "currency": "{{trigger.currency}}" }, "options": { "timeout": 45000 } } }, { "subject": "ms.hub.config.node.805092869.11223344", "data": { "name": "ValidateCardV2", "node_type": "function", "subject": "quiva-function.card-validator-v2", "payload": { "card_number": "{{trigger.card}}", "cvv": "{{trigger.cvv}}" } } } ] }, "UpdateMixedNodeTypes": { "summary": "Update nodes of different types", "value": [ { "subject": "ms.hub.config.node.805092869.98765432", "data": { "name": "ProcessPayment", "node_type": "function", "subject": "quiva-function.stripe-charge", "payload": { "amount": "{{trigger.amount}}" } } }, { "subject": "ms.hub.config.node.1025086208.55667788", "data": { "name": "TransformOrder", "node_type": "map", "payload": { "order_id": "{{trigger.id}}", "status": "processed" } } }, { "subject": "ms.hub.config.node.805092869.33445566", "data": { "name": "CheckThreshold", "node_type": "condition", "payload": { "condition": "{{trigger.total > 500}}" } } } ] }, "ArchiveMultipleNodes": { "summary": "Archive multiple deprecated nodes", "value": [ { "subject": "ms.hub.config.node.805092869.oldnode1", "data": { "name": "DeprecatedNode1", "node_type": "function", "subject": "quiva-function.old-function" }, "archived": true }, { "subject": "ms.hub.config.node.805092869.oldnode2", "data": { "name": "DeprecatedNode2", "node_type": "map", "payload": {} }, "archived": true } ] } } } } }, "responses": { "200": { "description": "All nodes updated successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateMultiNodeResponse" }, "examples": { "AllSuccess": { "summary": "All nodes updated successfully", "value": [ { "node": { "subject": "ms.hub.config.node.805092869.98765432", "data": { "name": "ProcessPaymentV2", "node_type": "function", "subject": "quiva-function.stripe-charge-v2", "payload": { "amount": "{{trigger.amount}}" } } }, "result": "success" }, { "node": { "subject": "ms.hub.config.node.805092869.11223344", "data": { "name": "ValidateCardV2", "node_type": "function", "subject": "quiva-function.card-validator-v2", "payload": { "card_number": "{{trigger.card}}" } } }, "result": "success" } ] } } } } }, "400": { "description": "Some nodes failed to update", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateMultiNodeErrorResponse" }, "example": { "body": [ { "node": { "subject": "ms.hub.config.node.1234567890.98765432", "data": { "name": "UpdatedNode1", "node_type": "function", "subject": "quiva-function.function1", "payload": { "param1": "value1" } } }, "result": "succes" }, { "node": { "subject": "ms.hub.config.node.1234567890.12345678", "data": { "name": "UpdatedNode2", "node_type": "function", "subject": "quiva-function.non-existing-function", "payload": { "param2": "value2" } } }, "result": "error: function not found" } ], "error": "some nodes failed to upsert" } } } } } } }, "/hub/workflows": { "post": { "tags": [ "Workflows" ], "summary": "Create a new workflow", "description": "Creates a new workflow for defining node sequences", "operationId": "createWorkflow", "x-resource-type": "service", "x-resource": "microstrate.hub.post.workflow", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateWorkflowRequest" }, "examples": { "simpleWorkflow": { "summary": "Simple two-node workflow", "value": { "name": "MyWorkflow", "collection": "ms.hub.config.collection.workflow.1234567890", "description": "A workflow that processes data", "config": { "nodes": [ { "data": { "id": "start", "name": "Start", "node_type": "map", "payload": { "message": "Start of workflow" } } }, { "data": { "id": "process", "name": "Process", "node_type": "function", "subject": "quiva-function.process-function", "payload": { "input": "{start}" } } } ], "edges": [ { "source": "start", "target": "process", "id": "edge1" } ], "result": "process" } } }, "conditionalWorkflow": { "summary": "Workflow with conditional branching", "value": { "name": "ConditionalProcessing", "collection": "ms.hub.config.collection.workflow.9876543210", "description": "A workflow with conditional logic", "config": { "nodes": [ { "data": { "id": "input", "name": "Input Handler", "node_type": "map", "payload": { "data": "{trigger.body}" } } }, { "data": { "id": "check_type", "name": "Check Type", "node_type": "condition", "payload": { "condition": "{input.type} == 'premium'" } } }, { "data": { "id": "premium_handler", "name": "Premium Handler", "node_type": "function", "subject": "quiva-function.premium-processor", "payload": { "input": "{input}" } } }, { "data": { "id": "standard_handler", "name": "Standard Handler", "node_type": "function", "subject": "quiva-function.standard-processor", "payload": { "input": "{input}" } } } ], "edges": [ { "source": "input", "target": "check_type", "id": "e1" }, { "source": "check_type", "target": "premium_handler", "id": "e2", "sourceHandle": "true" }, { "source": "check_type", "target": "standard_handler", "id": "e3", "sourceHandle": "false" } ], "result": "{check_type} ? {premium_handler} : {standard_handler}" } } }, "debouncedWorkflow": { "summary": "Workflow with debouncing", "value": { "name": "DebouncedNotifications", "collection": "ms.hub.config.collection.workflow.5555555555", "description": "Debounces rapid notifications by user", "config": { "nodes": [ { "data": { "id": "aggregate", "name": "Aggregate Events", "node_type": "map", "payload": { "user_id": "{trigger.user_id}", "events": "{trigger.events}" } } }, { "data": { "id": "send_notification", "name": "Send Notification", "node_type": "function", "subject": "quiva-function.send-email", "payload": { "to": "{aggregate.user_id}", "body": "{aggregate.events}" } } } ], "edges": [ { "source": "aggregate", "target": "send_notification", "id": "e1" } ], "result": "send_notification", "options": { "run_type": "debounced", "debounce_on": "{trigger.user_id}", "debounce_time": 5000, "debounce_max": 30000 } } } }, "evalWorkflow": { "summary": "Workflow using eval node for calculations", "value": { "name": "PriceCalculator", "collection": "ms.hub.config.collection.workflow.7777777777", "description": "Calculates pricing with discounts", "config": { "nodes": [ { "data": { "id": "get_prices", "name": "Get Base Prices", "node_type": "function", "subject": "quiva-function.get-pricing", "payload": { "product_ids": "{trigger.products}" } } }, { "data": { "id": "calculate_total", "name": "Calculate Total", "node_type": "eval", "payload": { "code": "const prices = get_prices.items; const subtotal = prices.reduce((sum, p) => sum + p.price * p.quantity, 0); const discount = trigger.discount_percent || 0; return { subtotal, discount: subtotal * discount / 100, total: subtotal * (1 - discount / 100) };" } } } ], "edges": [ { "source": "get_prices", "target": "calculate_total", "id": "e1" } ], "result": "calculate_total" } } }, "nestedFlowWorkflow": { "summary": "Workflow calling another flow", "value": { "name": "OrderProcessor", "collection": "ms.hub.config.collection.workflow.8888888888", "description": "Processes orders by calling sub-workflows", "config": { "nodes": [ { "data": { "id": "validate", "name": "Validate Order", "node_type": "function", "subject": "quiva-function.validate-order", "payload": { "order": "{trigger.order}" } } }, { "data": { "id": "process_payment", "name": "Process Payment", "node_type": "flow", "subject": "ms.hub.config.workflow.8888888888.payment-flow", "await": true, "payload": { "amount": "{validate.total}", "customer_id": "{trigger.customer_id}" } } }, { "data": { "id": "fulfill", "name": "Fulfill Order", "node_type": "flow", "subject": "ms.hub.config.workflow.8888888888.fulfillment-flow", "await": false, "payload": { "order_id": "{validate.order_id}", "payment_ref": "{process_payment.reference}" } } } ], "edges": [ { "source": "validate", "target": "process_payment", "id": "e1" }, { "source": "process_payment", "target": "fulfill", "id": "e2" } ], "result": "fulfill" } } }, "integrationWorkflow": { "summary": "Workflow with external integration", "value": { "name": "SlackNotifier", "collection": "ms.hub.config.collection.workflow.3333333333", "description": "Sends notifications to Slack", "config": { "nodes": [ { "data": { "id": "format_message", "name": "Format Message", "node_type": "map", "payload": { "channel": "#alerts", "text": "Alert: {trigger.message}", "blocks": [ { "type": "section", "text": { "type": "mrkdwn", "text": "*{trigger.title}*\n{trigger.message}" } } ] } } }, { "data": { "id": "send_slack", "name": "Send to Slack", "node_type": "integration", "subject": "slack.chat.postMessage", "payload": "{format_message}", "options": { "timeout": 10000, "attempts": 3, "backoff_ms": 1000 } } } ], "edges": [ { "source": "format_message", "target": "send_slack", "id": "e1" } ], "result": "send_slack" } } } } } } }, "responses": { "201": { "description": "Workflow created successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateWorkflowResponse" }, "examples": { "simpleWorkflowCreated": { "summary": "Simple workflow created", "value": { "subject": "ms.hub.config.workflow.draft.1234567890.98765432", "name": "MyWorkflow", "collection": "ms.hub.config.collection.workflow.1234567890", "description": "A workflow that processes data", "config": { "nodes": [ { "data": { "id": "start", "name": "Start", "node_type": "map", "payload": { "message": "Start of workflow" } } }, { "data": { "id": "process", "name": "Process", "node_type": "function", "subject": "quiva-function.process-function", "payload": { "input": "{start}" } } } ], "edges": [ { "source": "start", "target": "process", "id": "edge1" } ], "result": "process" }, "modified": 1651395678 } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" }, "examples": { "NameRequired": { "value": { "error": "a name is required" } }, "CollectionRequired": { "value": { "error": "a collection subject is required" } }, "InvalidCollection": { "value": { "error": "invalid collection subject" } }, "InvalidNodeId": { "value": { "error": "invalid ID. An ID must start with a letter or underscore and must contain only alphanumeric characters, hyphens and underscores" } }, "ReservedWord": { "value": { "error": "cannot use a reserved word as a node id:trigger" } }, "PayloadRequired": { "value": { "error": "payload is required:nodeId" } }, "FunctionSubjectRequired": { "value": { "error": "a subject is required for the function:nodeId" } }, "FlowSubjectRequired": { "value": { "error": "a subject is required for the flow:nodeId" } }, "DuplicateNodeId": { "value": { "error": "duplicate node id found:nodeId" } }, "EdgeSourceTargetRequired": { "value": { "error": "source and target required on edge: source->target" } }, "SourceNodeNotFound": { "value": { "error": "source node not found:source->target" } }, "TargetNodeNotFound": { "value": { "error": "target node not found:source->target" } } } } } }, "404": { "description": "Resource not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" }, "examples": { "CollectionNotFound": { "value": { "error": "collection not found" } }, "FunctionNotFound": { "value": { "error": "function not found" } } } } } }, "409": { "description": "Workflow already exists", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" }, "example": { "error": "workflow exists:ms.hub.config.workflow.draft.1234567890.98765432" } } } } } }, "get": { "tags": [ "Workflows" ], "summary": "List workflows", "description": "Retrieves a list of workflows, optionally filtered by collection and type", "operationId": "listWorkflows", "x-resource-type": "service", "x-resource": "microstrate.hub.get.list-workflows", "parameters": [ { "$ref": "#/components/parameters/collectionTopic" }, { "name": "filter", "in": "query", "description": "Filter workflows by type. If not specified, all types will be listed", "required": false, "schema": { "type": "string", "enum": [ "draft", "published" ] }, "examples": { "draft": { "summary": "List only draft workflows", "value": "draft" }, "published": { "summary": "List only published workflows", "value": "published" } } } ], "responses": { "200": { "description": "Workflows retrieved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ListWorkflowsResponse" }, "examples": { "multipleWorkflows": { "summary": "Multiple workflows returned", "value": { "results": [ { "subject": "ms.hub.config.workflow.draft.1234567890.98765432", "name": "DataProcessor", "description": "Processes incoming data", "config": { "nodes": [ { "data": { "id": "input", "name": "Input", "node_type": "map", "payload": { "data": "{trigger}" } } } ], "edges": [], "result": "input" }, "modified": 1651395678 }, { "subject": "ms.hub.config.workflow.draft.1234567890.12345678", "name": "NotificationSender", "description": "Sends notifications to users", "config": { "nodes": [ { "data": { "id": "send", "name": "Send", "node_type": "function", "subject": "quiva-function.send-email", "payload": { "to": "{trigger.email}" } } } ], "edges": [], "result": "send" }, "modified": 1651395679 } ], "results_total": 2 } }, "emptyList": { "summary": "No workflows found", "value": { "results": [], "results_total": 0 } }, "singleWorkflow": { "summary": "Single workflow returned", "value": { "results": [ { "subject": "ms.hub.config.workflow.1234567890.11111111", "name": "ProductionWorkflow", "description": "Published production workflow", "config": { "nodes": [ { "data": { "id": "process", "name": "Process", "node_type": "function", "subject": "quiva-function.processor", "payload": {} } } ], "edges": [], "result": "process" }, "modified": 1651400000 } ], "results_total": 1 } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" }, "example": { "error": "invalid request" } } } } } } }, "/hub/workflows/{collection_topic}/{flow_topic}": { "parameters": [ { "$ref": "#/components/parameters/collectionTopic" }, { "$ref": "#/components/parameters/flowTopic" } ], "get": { "tags": [ "Workflows" ], "summary": "Get a workflow", "description": "Retrieves a specific workflow by subject", "operationId": "getWorkflow", "x-resource-type": "service", "x-resource": "microstrate.hub.get.workflow", "parameters": [ { "$ref": "#/components/parameters/queryDraftFlag" } ], "responses": { "200": { "description": "Workflow retrieved successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetWorkflowResponse" }, "examples": { "simpleWorkflow": { "summary": "Simple workflow with map and function nodes", "value": { "subject": "ms.hub.config.workflow.1234567890.98765432", "name": "MyWorkflow", "description": "Workflow description", "config": { "nodes": [ { "data": { "id": "start", "name": "Start", "node_type": "map", "payload": { "message": "Start of workflow" } } }, { "data": { "id": "process", "name": "Process", "node_type": "function", "subject": "quiva-function.process-function", "payload": { "input": "{start}" } } } ], "edges": [ { "source": "start", "target": "process", "id": "edge1" } ], "result": "process" }, "modified": 1651395678 } }, "draftWorkflow": { "summary": "Draft workflow with static data", "value": { "subject": "ms.hub.config.workflow.draft.1234567890.55555555", "name": "DraftWorkflow", "description": "Work in progress workflow", "config": { "nodes": [ { "data": { "id": "init", "name": "Initialize", "node_type": "map", "payload": { "config": "{static.defaultConfig}", "input": "{trigger}" } } } ], "edges": [], "static": { "defaultConfig": { "timeout": 30000, "retries": 3 } }, "result": "init" }, "modified": 1651400000 } }, "complexWorkflow": { "summary": "Complex workflow with multiple node types", "value": { "subject": "ms.hub.config.workflow.1234567890.77777777", "name": "OrderProcessingWorkflow", "description": "Complete order processing pipeline", "config": { "nodes": [ { "data": { "id": "validate_input", "name": "Validate Input", "node_type": "function", "subject": "quiva-function.validate-order", "payload": { "order": "{trigger.order}" }, "options": { "timeout": 5000 } } }, { "data": { "id": "check_inventory", "name": "Check Inventory", "node_type": "function", "subject": "quiva-function.check-stock", "payload": { "items": "{validate_input.items}" } } }, { "data": { "id": "has_stock", "name": "Has Stock?", "node_type": "condition", "payload": { "condition": "{check_inventory.available} == true" } } }, { "data": { "id": "process_order", "name": "Process Order", "node_type": "flow", "subject": "ms.hub.config.workflow.1234567890.order-processor", "await": true, "payload": { "order": "{validate_input}" } } }, { "data": { "id": "backorder", "name": "Create Backorder", "node_type": "function", "subject": "quiva-function.create-backorder", "payload": { "order": "{validate_input}" } } }, { "data": { "id": "notify_customer", "name": "Notify Customer", "node_type": "integration", "subject": "email.send", "payload": { "to": "{trigger.customer_email}", "template": "order_confirmation", "data": "{process_order}" } } } ], "edges": [ { "source": "validate_input", "target": "check_inventory", "id": "e1" }, { "source": "check_inventory", "target": "has_stock", "id": "e2" }, { "source": "has_stock", "target": "process_order", "id": "e3", "sourceHandle": "true" }, { "source": "has_stock", "target": "backorder", "id": "e4", "sourceHandle": "false" }, { "source": "process_order", "target": "notify_customer", "id": "e5" } ], "result": "{has_stock} ? {notify_customer} : {backorder}" }, "modified": 1651450000 } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" }, "examples": { "InvalidSubject": { "value": { "error": "invalid subject" } } } } } } } }, "patch": { "tags": [ "Workflows" ], "summary": "Update a workflow", "description": "Updates an existing draft workflow's properties", "operationId": "updateWorkflow", "x-resource-type": "service", "x-resource": "microstrate.hub.patch.workflow", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateWorkflowRequest" }, "examples": { "updateNameAndDescription": { "summary": "Update name and description only", "value": { "name": "UpdatedWorkflowName", "description": "Updated workflow description" } }, "updateConfig": { "summary": "Update workflow configuration", "value": { "name": "UpdatedWorkflow", "description": "Updated workflow description", "config": { "nodes": [ { "data": { "id": "start", "name": "Start", "node_type": "map", "payload": { "message": "Updated start of workflow" } } }, { "data": { "id": "process", "name": "Process", "node_type": "function", "subject": "quiva-function.updated-process-function", "payload": { "input": "{start}" } } } ], "edges": [ { "source": "start", "target": "process", "id": "edge1" } ], "result": "process" } } }, "addNode": { "summary": "Add a new node to existing workflow", "value": { "config": { "nodes": [ { "data": { "id": "start", "name": "Start", "node_type": "map", "payload": { "message": "Start" } } }, { "data": { "id": "process", "name": "Process", "node_type": "function", "subject": "quiva-function.process", "payload": { "input": "{start}" } } }, { "data": { "id": "notify", "name": "Notify", "node_type": "integration", "subject": "slack.chat.postMessage", "payload": { "channel": "#alerts", "text": "Processed: {process.result}" } } } ], "edges": [ { "source": "start", "target": "process", "id": "e1" }, { "source": "process", "target": "notify", "id": "e2" } ], "result": "notify" } } }, "archiveWorkflow": { "summary": "Archive a workflow", "value": { "archived": true } } } } } }, "responses": { "200": { "description": "Workflow updated successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateWorkflowResponse" }, "examples": { "updated": { "summary": "Workflow updated successfully", "value": { "subject": "ms.hub.config.workflow.draft.1234567890.98765432", "name": "UpdatedWorkflow", "description": "Updated workflow description", "config": { "nodes": [ { "data": { "id": "start", "name": "Start", "node_type": "map", "payload": { "message": "Updated start of workflow" } } }, { "data": { "id": "process", "name": "Process", "node_type": "function", "subject": "quiva-function.updated-process-function", "payload": { "input": "{start}" } } } ], "edges": [ { "source": "start", "target": "process", "id": "edge1" } ], "result": "process" }, "modified": 1651395678 } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" }, "examples": { "SubjectRequired": { "value": { "error": "subject is required" } }, "InvalidDraftSubject": { "value": { "error": "a valid draft subject is required" } } } } } }, "404": { "description": "Workflow not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" }, "example": { "error": "workflow not found" } } } } } }, "delete": { "tags": [ "Workflows" ], "summary": "Delete a workflow", "description": "Deletes a specific workflow by subject", "operationId": "deleteWorkflow", "x-resource-type": "service", "x-resource": "microstrate.hub.delete.workflow", "responses": { "200": { "description": "Workflow deleted successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SuccessResponse" }, "example": { "message": "success" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" }, "examples": { "InvalidSubject": { "value": { "error": "invalid subject" } } } } } } } } }, "/hub/workflows/{collection_topic}/{flow_topic}/run": { "parameters": [ { "$ref": "#/components/parameters/collectionTopic" }, { "$ref": "#/components/parameters/flowTopic" }, { "$ref": "#/components/parameters/queryDraftFlag" } ], "post": { "tags": [ "Workflows" ], "summary": "Run a workflow", "description": "Executes a workflow with the specified trigger data", "operationId": "runWorkflow", "x-resource-type": "service", "x-resource": "microstrate.hub.post.workflow-run", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RunWorkflowRequest" }, "examples": { "singleTriggerSync": { "summary": "Single trigger with synchronous execution", "value": { "trigger": { "user_id": "user_123", "action": "process_order", "data": { "order_id": "ORD-456", "items": [ { "sku": "PROD-001", "quantity": 2 }, { "sku": "PROD-002", "quantity": 1 } ], "total": 149.99 } }, "enable_log": true, "await": true } }, "singleTriggerAsync": { "summary": "Single trigger with asynchronous execution", "value": { "trigger": { "event_type": "webhook", "payload": { "source": "external_system", "data": { "key": "value" } } }, "enable_log": false, "await": false } }, "multipleTriggers": { "summary": "Multiple triggers for batch processing", "value": { "triggers": [ { "user_id": "user_001", "email": "user1@example.com", "notification_type": "welcome" }, { "user_id": "user_002", "email": "user2@example.com", "notification_type": "welcome" }, { "user_id": "user_003", "email": "user3@example.com", "notification_type": "welcome" } ], "enable_log": true, "await": false } }, "minimalTrigger": { "summary": "Minimal trigger with just data", "value": { "trigger": { "message": "Hello, World!" } } }, "complexTrigger": { "summary": "Complex trigger with nested data", "value": { "trigger": { "timestamp": 1651395678, "source": "api", "customer": { "id": "cust_789", "name": "John Doe", "email": "john@example.com", "tier": "premium" }, "order": { "id": "ORD-12345", "items": [ { "product_id": "P001", "name": "Widget", "quantity": 5, "unit_price": 19.99 }, { "product_id": "P002", "name": "Gadget", "quantity": 2, "unit_price": 49.99 } ], "shipping": { "method": "express", "address": { "street": "123 Main St", "city": "Springfield", "country": "US" } } }, "metadata": { "utm_source": "google", "campaign_id": "summer_sale" } }, "enable_log": true, "await": true } } } } } }, "responses": { "200": { "description": "Workflow executed successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RunWorkflowResponse" }, "examples": { "awaitedSuccess": { "summary": "Synchronous execution completed", "value": { "trackingId": "ms.hub.run.abcdef-1234-5678-90ab-cdef12345678.ms.hub.config.workflow.1234567890.98765432", "result": { "status": "completed", "order_id": "ORD-456", "processed_at": "2024-01-15T10:30:00Z", "confirmation_number": "CONF-789012" } } }, "notAwaitedSuccess": { "summary": "Asynchronous execution started", "value": { "trackingId": "ms.hub.run.fedcba-9876-5432-10ab-cdef98765432.ms.hub.config.workflow.1234567890.98765432" } }, "debouncedRun": { "summary": "Debounced execution", "value": { "body": "debounced run: user_123-notifications" } }, "orderedRun": { "summary": "Ordered execution queued", "value": "ordered run: order_queue-ORD-456" }, "complexResult": { "summary": "Complex workflow result", "value": { "trackingId": "ms.hub.run.12345678-abcd-efgh-ijkl-mnopqrstuvwx.ms.hub.config.workflow.9876543210.11111111", "result": { "validation": { "status": "passed", "checks": [ "inventory", "payment", "fraud" ] }, "processing": { "order_id": "ORD-12345", "payment_id": "PAY-67890", "fulfillment_id": "FUL-11111" }, "notifications_sent": [ { "type": "email", "status": "sent" }, { "type": "sms", "status": "sent" } ], "metadata": { "duration_ms": 1523, "nodes_executed": 7 } } } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" }, "examples": { "NoTrigger": { "value": { "error": "no trigger specified" } }, "ArchivedFlow": { "value": { "error": "cannot run an archived flow" } }, "MissingConfig": { "value": { "error": "missing configuration" } }, "NodesRequired": { "value": { "error": "nodes are required" } }, "DebounceError": { "value": { "error": "failed to resolve debounceOn" } }, "OrderOnError": { "value": { "error": "failed to resolve orderOn" } } } } } } } } }, "/hub/workflows/{collection_topic}/{flow_topic}/history": { "parameters": [ { "$ref": "#/components/parameters/collectionTopic" }, { "$ref": "#/components/parameters/flowTopic" }, { "$ref": "#/components/parameters/queryDraftFlag" } ], "get": { "tags": [ "Workflows" ], "summary": "Workflow Configuration History", "description": "Get workflow configuration history", "operationId": "workflowHistory", "x-resource-type": "service", "x-resource": "microstrate.hub.get.workflow-history", "responses": { "200": { "description": "Workflow history", "content": { "application/json": { "schema": { "type": "array", "description": "An array of full configuration versions", "items": { "$ref": "#/components/schemas/WorkflowConfig" } }, "examples": { "multipleVersions": { "summary": "Multiple configuration versions", "value": [ { "nodes": [ { "data": { "id": "start", "name": "Start", "node_type": "map", "payload": { "message": "Version 3 - Current" } } }, { "data": { "id": "process", "name": "Process", "node_type": "function", "subject": "quiva-function.process-v3", "payload": { "input": "{start}" } } }, { "data": { "id": "notify", "name": "Notify", "node_type": "integration", "subject": "slack.chat.postMessage", "payload": { "channel": "#alerts", "text": "{process.result}" } } } ], "edges": [ { "source": "start", "target": "process", "id": "e1" }, { "source": "process", "target": "notify", "id": "e2" } ], "result": "notify" }, { "nodes": [ { "data": { "id": "start", "name": "Start", "node_type": "map", "payload": { "message": "Version 2" } } }, { "data": { "id": "process", "name": "Process", "node_type": "function", "subject": "quiva-function.process-v2", "payload": { "input": "{start}" } } } ], "edges": [ { "source": "start", "target": "process", "id": "e1" } ], "result": "process" }, { "nodes": [ { "data": { "id": "start", "name": "Start", "node_type": "map", "payload": { "message": "Version 1 - Initial" } } } ], "edges": [], "result": "start" } ] }, "singleVersion": { "summary": "Single version (new workflow)", "value": [ { "nodes": [ { "data": { "id": "init", "name": "Initialize", "node_type": "map", "payload": { "status": "ready" } } } ], "edges": [], "result": "init" } ] }, "emptyHistory": { "summary": "No history available", "value": [] } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" }, "examples": { "NoTrigger": { "value": { "error": "no trigger specified" } }, "ArchivedFlow": { "value": { "error": "cannot run an archived flow" } }, "MissingConfig": { "value": { "error": "missing configuration" } }, "NodesRequired": { "value": { "error": "nodes are required" } }, "DebounceError": { "value": { "error": "failed to resolve debounceOn" } }, "OrderOnError": { "value": { "error": "failed to resolve orderOn" } } } } } } } } }, "/hub/workflows/publish": { "post": { "tags": [ "Workflows" ], "summary": "Publish a workflow", "description": "Publishes a draft workflow to make it available for execution", "operationId": "publishWorkflow", "x-resource-type": "service", "x-resource": "microstrate.hub.post.workflow-publish", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PublishWorkflowRequest" }, "example": { "subject": "ms.hub.config.workflow.draft.1234567890.98765432" } } } }, "responses": { "200": { "description": "Workflow published successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SuccessResponse" }, "example": { "message": "success" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" }, "examples": { "InvalidSubject": { "value": { "error": "a valid draft subject is required" } } } } } } } } }, "/hub/integrations/oauth-config": { "get": { "summary": "List OAuth configurations", "description": "Get list of all OAuth configurations", "operationId": "getIntegrationsOauthConfigs", "tags": [ "Oauth" ], "x-resource-type": "service", "x-resource": "microstrate.hub.get.oauth-configs", "responses": { "200": { "description": "List of OAuth configurations", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OauthConfigList" }, "example": { "results": [ { "integration_id": "slack", "name": "Slack API", "scopes": "channels:read,chat:write,users:read", "subject": "ms.integration.oauth.config.slack" }, { "integration_id": "xero", "name": "Xero API's", "scopes": "email,openid,profile,assets,assets.read,files,files.read,projects,projects.read", "subject": "ms.integration.oauth.config.xero" }, { "integration_id": "google", "name": "Google Workspace", "scopes": "https://www.googleapis.com/auth/gmail.readonly,https://www.googleapis.com/auth/calendar", "subject": "ms.integration.oauth.config.google" } ], "results_total": 3 } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/hub/integrations/{integration_id}/oauth-config": { "parameters": [ { "$ref": "#/components/parameters/integrationId" } ], "get": { "summary": "Get OAuth configuration", "description": "Get OAuth configuration for a specific integration", "operationId": "getIntegrationOauthConfig", "tags": [ "Oauth" ], "x-resource-type": "service", "x-resource": "microstrate.hub.get.oauth-config", "responses": { "200": { "description": "OAuth configuration", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OauthConfigBasicData" }, "examples": { "slack": { "summary": "Slack OAuth config", "value": { "integration_id": "slack", "name": "Slack API", "scopes": "channels:read,chat:write,users:read", "subject": "ms.integration.oauth.config.slack" } }, "xero": { "summary": "Xero OAuth config", "value": { "integration_id": "xero", "name": "Xero API's", "scopes": "email,openid,profile,assets,assets.read", "subject": "ms.integration.oauth.config.xero" } } } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } }, "put": { "summary": "Update an OAuth configuration.", "description": "[quiva.ai admins only] Update the OAuth configuration for a specific integration - full configuration replacement", "operationId": "putIntegrationsOauthConfig", "tags": [ "Oauth" ], "x-resource-type": "service", "x-resource": "microstrate.hub.put.oauth-config", "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/IntegrationOauthConfig" }, "examples": { "slack": { "summary": "Slack OAuth configuration", "value": { "integration_id": "slack", "name": "Slack API", "scopes": "channels:read,chat:write,users:read,files:read", "client_id": "123456789.987654321", "client_secret": "abcdef1234567890abcdef", "auth_url": "https://slack.com/oauth/v2/authorize", "token_url": "https://slack.com/api/oauth.v2.access", "redirect_url": "https://api.quiva.ai/hub/integrations/oauth-callback" } }, "github": { "summary": "GitHub OAuth configuration", "value": { "integration_id": "github", "name": "GitHub API", "scopes": "repo,read:user,read:org", "client_id": "Iv1.a1b2c3d4e5f6g7h8", "client_secret": "secret123456789abcdef", "auth_url": "https://github.com/login/oauth/authorize", "token_url": "https://github.com/login/oauth/access_token", "redirect_url": "https://api.quiva.ai/hub/integrations/oauth-callback" } } } } } }, "responses": { "200": { "description": "OAuth configuration", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SuccessResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } }, "delete": { "summary": "Delete an OAuth configuration.", "description": "[quiva.ai admins only] Deletes an OAuth configuration for a specific integration", "operationId": "deleteIntegrationsOauthConfig", "tags": [ "Oauth" ], "x-resource-type": "service", "x-resource": "microstrate.hub.delete.oauth-config", "responses": { "200": { "description": "OAuth configuration", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SuccessResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/hub/integrations/oauth-connections": { "get": { "summary": "List OAuth connections", "description": "Get list of OAuth connections for the authenticated user", "operationId": "getIntegrationsOauthConnections", "tags": [ "Oauth" ], "x-resource-type": "service", "x-resource": "microstrate.hub.get.oauth-connections", "responses": { "200": { "description": "List of OAuth connections", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OauthConnectionsList" }, "example": { "results": [ { "access_token": "eyJhbGciOiJSUzI1Ni...", "token_type": "Bearer", "refresh_token": "xoxr-123456789012-refresh-token", "expiry": "2025-06-15T14:30:00.000000+00:00", "expires_in": 43200, "sequence": 42, "subject": "ms.integration.oauth.AC75JGNMJHTRQNXCBDMIAJCJ57HAEWP2RGWXJCIFFGW2K64OKG267A2D.slack.workspace1", "modified": 1749912600 }, { "access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...", "token_type": "Bearer", "refresh_token": "ulpL_xero_refresh_token_abc123", "expiry": "2025-06-15T15:00:00.000000+00:00", "expires_in": 1800, "sequence": 85, "subject": "ms.integration.oauth.AC75JGNMJHTRQNXCBDMIAJCJ57HAEWP2RGWXJCIFFGW2K64OKG267A2D.xero.demo", "modified": 1749914400 }, { "access_token": "eyJhbGciOiJSUzI1Ni...", "token_type": "Bearer", "expiry": "2025-12-31T23:59:59.000000+00:00", "expires_in": 31536000, "sequence": 12, "subject": "ms.integration.oauth.AC75JGNMJHTRQNXCBDMIAJCJ57HAEWP2RGWXJCIFFGW2K64OKG267A2D.github.personal", "modified": 1749900000 } ], "results_total": 3 } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/hub/integrations/{integration_id}/oauth-token/{connection_id}": { "parameters": [ { "$ref": "#/components/parameters/integrationId" }, { "$ref": "#/components/parameters/connectionId" } ], "get": { "summary": "Get OAuth connection", "description": "Get OAuth connection details for a specific integration and connection", "operationId": "getIntegrationsOauthConnection", "tags": [ "Oauth" ], "x-resource-type": "service", "x-resource": "microstrate.hub.get.integration-oauth-token", "responses": { "200": { "description": "OAuth connection details", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OauthConnection" }, "example": { "access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...", "token_type": "Bearer", "refresh_token": "ulpL_xGHJwk9RmT2PnCq...", "expiry": "2025-05-29T17:09:39.816102+01:00", "expires_in": 1800, "sequence": 85, "subject": "ms.integration.oauth.AC75JGNMJHTRQNXCBDMIAJCJ57HAEWP2RGWXJCIFFGW2K64OKG267A2D.xero.demo", "modified": 1748533179 } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/hub/integrations/{integration_id}/oauth-connections": { "parameters": [ { "$ref": "#/components/parameters/integrationId" } ], "get": { "summary": "Get integration connections", "description": "Gets integration connections by integration_id", "operationId": "getIntegrationConnections", "tags": [ "Oauth" ], "x-resource-type": "service", "x-resource": "microstrate.hub.get.oauth-connection", "responses": { "200": { "description": "Connection deleted successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OauthConnection" }, "example": { "results": [ { "access_token": "eyJhbGciOiJSUzI1NiIs...", "token_type": "Bearer", "refresh_token": "ulpL_...", "expiry": "2025-05-29T17:09:39.816102+01:00", "expires_in": 1800, "sequence": 85, "subject": "ms.integration.oauth.AC75JGNMJHTRQNXCBDMIAJCJ57HAEWP2RGWXJCIFFGW2K64OKG267A2D.xero.demo", "modified": 1748533179 }, { "access_token": "eyJhbGciOiJSUzI1NiIs...", "token_type": "Bearer", "refresh_token": "pSn5h...", "expiry": "2025-05-29T17:11:54.397804+01:00", "expires_in": 1800, "sequence": 86, "subject": "ms.integration.oauth.AC75JGNMJHTRQNXCBDMIAJCJ57HAEWP2RGWXJCIFFGW2K64OKG267A2D.xero.maria", "modified": 1748533314 } ], "results_total": 2 } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/hub/integrations/{integration_id}/oauth-connections/{connection_id}": { "delete": { "summary": "Delete OAuth connection", "description": "Delete an OAuth connection for a specific integration", "operationId": "deleteIntegrationsOauthConnection", "tags": [ "Oauth" ], "x-resource-type": "service", "x-resource": "microstrate.hub.delete.oauth-connection", "parameters": [ { "$ref": "#/components/parameters/integrationId" }, { "$ref": "#/components/parameters/connectionId" } ], "responses": { "200": { "description": "Connection deleted successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SuccessResponse" } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/hub/integrations/oauth-callback": { "get": { "summary": "OAuth callback", "description": "Handle OAuth callback after user authorization", "operationId": "integrationsOauthCallback", "tags": [ "Oauth" ], "x-resource-type": "service", "x-resource": "microstrate.accounts.get.oauth-callback", "parameters": [ { "name": "code", "in": "query", "required": true, "schema": { "type": "string" }, "description": "OAuth authorization code", "example": "4/0AX4XfWgq1P2fJdK8V9L3m..." }, { "name": "state", "in": "query", "required": true, "schema": { "type": "string" }, "description": "OAuth state parameter", "example": "abc123xyz789def456ghi" } ], "responses": { "200": { "description": "OAuth token received and saved", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OauthConnection" }, "example": { "access_token": "eyJhbGciOiJSUzI1Ni...", "token_type": "Bearer", "refresh_token": "dGhpcyBpcyBhIHJlZnJlc2ggdG9rZW4...", "expiry": "2025-06-01T12:00:00.000000+00:00", "expires_in": 3600, "sequence": 1, "subject": "ms.integration.oauth.AC75JGNMJHTRQNXCBDMIAJCJ57HAEWP2RGWXJCIFFGW2K64OKG267A2D.slack.workspace1", "modified": 1748620800 } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }, "/hub/integrations/{integration_id}/oauth-refresh-token/{connection_id}": { "get": { "summary": "Refresh OAuth token", "description": "Refresh an OAuth access token using the refresh token", "operationId": "refreshIntegrationsOauthToken", "tags": [ "Oauth" ], "x-resource-type": "service", "x-resource": "microstrate.hub.get.integration-oauth-refresh", "parameters": [ { "$ref": "#/components/parameters/integrationId" }, { "$ref": "#/components/parameters/connectionId" }, { "name": "refresh_token", "in": "query", "required": true, "schema": { "type": "string" }, "description": "Refresh token", "example": "pSn5h..." } ], "responses": { "200": { "description": "Token refreshed successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OauthConnection" }, "example": { "access_token": "eyJhbGciOiJSUzI1Ni...", "token_type": "Bearer", "refresh_token": "bmV3UmVmcmVzaFRva2VuVmFsdWU...", "expiry": "2025-05-30T18:00:00.000000+01:00", "expires_in": 1800, "sequence": 87, "subject": "ms.integration.oauth.AC75JGNMJHTRQNXCBDMIAJCJ57HAEWP2RGWXJCIFFGW2K64OKG267A2D.xero.maria", "modified": 1748622000 } } } }, "400": { "description": "Bad request", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } } }, "components": { "schemas": { "Error": { "type": "object", "properties": { "error": { "type": "string" } } }, "CreateCollectionRequest": { "type": "object", "required": [ "name", "collection_type" ], "properties": { "name": { "type": "string", "description": "Name of the collection" }, "collection_type": { "type": "string", "enum": [ "node", "workflow" ], "description": "Type of the collection (node or workflow)" }, "description": { "type": "string", "description": "Optional description of the collection" } } }, "CreateCollectionResponse": { "type": "object", "properties": { "subject": { "type": "string", "description": "Subject identifier for the collection" }, "name": { "type": "string", "description": "Name of the collection" }, "collection_type": { "type": "string", "description": "Type of the collection (node or workflow)" }, "topic": { "type": "string", "description": "Hash of the collection name" }, "description": { "type": "string", "description": "Description of the collection" }, "modified": { "$ref": "#/components/schemas/Modified" } } }, "CreateNodeRequest": { "type": "object", "required": [ "collection", "data" ], "properties": { "collection": { "type": "string", "description": "Subject of the collection this node belongs to" }, "data": { "$ref": "#/components/schemas/NodeData" } } }, "CreateNodeResponse": { "type": "object", "properties": { "subject": { "type": "string", "description": "Subject identifier for the node" }, "collection": { "type": "string", "description": "Subject of the collection this node belongs to" }, "data": { "type": "object", "description": "Node data" }, "type": { "type": "string", "description": "Action type (created)" }, "modified": { "$ref": "#/components/schemas/Modified" } } }, "NodeData": { "type": "object", "properties": { "id": { "type": "string", "description": "Unique identifier for the node" }, "name": { "type": "string", "description": "Name of the node" }, "description": { "type": "string", "description": "Description of the node" }, "node_type": { "type": "string", "enum": [ "function", "flow", "condition", "map", "eval", "integration" ], "description": "## Node Types\n\n### 1. `function`\n**Definition**: \nA **Hydra function node** used to provide a *subject* or perform a custom computation. It encapsulates reusable logic defined within the Hydra platform.\n\n### 2. `flow`\n**Definition**: \nA node that **invokes another flow**, either **synchronously** or **asynchronously**, enabling flow modularization and reuse.\n\n### 3. `condition`\n**Definition**: \nA **branching node** that evaluates a condition to determine the **flow of execution**, similar to `if`/`else` logic in programming.\n\n### 4. `map`\n**Definition**: \nA **data transformation node** used to **reshape or remap the payload**, allowing the flow to adapt the structure of data as it progresses.\n\n### 5. `eval`\n**Definition**: \nExecutes **simple JavaScript code** to dynamically **evaluate expressions**, perform calculations, or manipulate data inline within the flow.\n\n### 6. `integration`\n**Definition**: \nSimilar to a `function` node, but specifically tied to **predefined APIs**. It uses an HTTP-like interface and references **a known set of external services** managed by the platform." }, "subject": { "type": "string", "description": "Subject identifier for function or flow node types" }, "payload": { "description": "Payload data for the node" }, "response_map": { "description": "Mapping for response transformation" }, "options": { "$ref": "#/components/schemas/NodeOptions" }, "await": { "type": "boolean", "description": "Whether to wait for completion nad return the result" } } }, "NodeOptions": { "type": "object", "description": "Node execution options", "properties": { "flat_map": { "type": "boolean", "description": "Whether to flatten the response" }, "backoff_ms": { "type": "integer", "format": "int64", "description": "Backoff duration in milliseconds - how long to wait before next attempt. Applies to function and flow nodes only." }, "timeout": { "type": "integer", "format": "int64", "description": "Timeout duration in milliseconds. Applies to function and flow nodes only." }, "attempts": { "type": "integer", "format": "int32", "description": "Number of retry attempts. Applies to function and flow nodes only." }, "ignore_response_codes": { "type": "array", "items": { "type": "integer" }, "description": "List of HTTP response codes to ignore. Applies to function nodes only." } } }, "Edge": { "type": "object", "required": [ "source", "target" ], "properties": { "source": { "type": "string", "description": "ID of the source node" }, "target": { "type": "string", "description": "ID of the target node" }, "id": { "type": "string", "description": "Optional unique identifier for the edge" }, "sourceHandle": { "type": "string", "description": "Optional source handle identifier" }, "targetHandle": { "type": "string", "description": "Optional target handle identifier" } } }, "WorkflowConfig": { "type": "object", "properties": { "nodes": { "type": "array", "items": { "type": "object", "properties": { "data": { "$ref": "#/components/schemas/NodeData" }, "position": { "type": "object", "description": "Visual position of the node in the workflow editor" }, "style": { "type": "object", "description": "Visual styling of the node" } } }, "description": "Array of nodes in the workflow" }, "edges": { "type": "array", "items": { "$ref": "#/components/schemas/Edge" }, "description": "Array of edges connecting nodes in the workflow" }, "static": { "type": "object", "description": "Static data available to all nodes in the workflow" }, "result": { "type": "string", "description": "Expression to determine the final result of the workflow" }, "options": { "type": "object", "properties": { "run_type": { "type": "string", "enum": [ "debounced", "ordered" ], "description": "Execution mode for the workflow" }, "order_on": { "type": "string", "description": "Field to order workflow executions by" }, "debounce_on": { "type": "string", "description": "Field to debounce workflow executions on" }, "debounce_time": { "type": "integer", "description": "Debounce time in milliseconds" }, "debounce_max": { "type": "integer", "description": "Maximum debounce time in milliseconds" } } } } }, "CreateWorkflowRequest": { "type": "object", "required": [ "name", "collection" ], "properties": { "name": { "type": "string", "description": "Name of the workflow" }, "collection": { "type": "string", "description": "Subject of the collection this workflow belongs to" }, "description": { "type": "string", "description": "Optional description of the workflow" }, "config": { "$ref": "#/components/schemas/WorkflowConfig" } } }, "CreateWorkflowResponse": { "type": "object", "properties": { "subject": { "type": "string", "description": "Subject identifier for the workflow" }, "name": { "type": "string", "description": "Name of the workflow" }, "collection": { "type": "string", "description": "Subject of the collection this workflow belongs to" }, "description": { "type": "string", "description": "Description of the workflow" }, "config": { "$ref": "#/components/schemas/WorkflowConfig" }, "modified": { "$ref": "#/components/schemas/Modified" } } }, "RunWorkflowRequest": { "type": "object", "properties": { "trigger": { "type": "object", "description": "Trigger data for workflow execution (use either trigger or triggers)" }, "triggers": { "type": "array", "items": { "type": "object" }, "description": "Multiple trigger data sets for parallel workflow execution" }, "enable_log": { "type": "boolean", "description": "Whether to enable logging of workflow execution", "default": false }, "await": { "type": "boolean", "description": "Whether to wait for workflow completion", "default": false } } }, "RunWorkflowResponse": { "oneOf": [ { "type": "object", "properties": { "trackingId": { "type": "string", "description": "ID for tracking the workflow execution" }, "result": { "type": "object", "description": "Result of the workflow execution" } } }, { "type": "string", "description": "Status message for debounced or ordered executions" } ] }, "PublishWorkflowRequest": { "type": "object", "required": [ "subject" ], "properties": { "subject": { "type": "string", "description": "Subject of the draft workflow to publish" } } }, "UpdateCollectionRequest": { "type": "object", "required": [ "subject" ], "properties": { "subject": { "type": "string", "description": "Subject of the collection to update" }, "description": { "type": "string", "description": "Updated description of the collection" } } }, "UpdateNodeRequest": { "type": "object", "required": [ "subject", "data" ], "properties": { "data": { "$ref": "#/components/schemas/NodeData" }, "archived": { "type": "boolean", "description": "Whether the node is archived" } } }, "UpdateMultiNodeRequest": { "type": "array", "items": { "$ref": "#/components/schemas/UpdateNodeRequest" } }, "UpdateMultiNodeResponse": { "type": "array", "items": { "type": "object", "properties": { "node": { "$ref": "#/components/schemas/UpdateNodeRequest" }, "result": { "type": "string", "description": "Result of the update operation" } } } }, "UpdateMultiNodeErrorResponse": { "type": "object", "properties": { "body": { "type": "array", "items": { "type": "object", "properties": { "node": { "$ref": "#/components/schemas/UpdateNodeRequest" }, "result": { "type": "string", "description": "Result of the update operation with error messages" } } } }, "error": { "type": "string", "description": "General error message" } } }, "UpdateWorkflowRequest": { "type": "object", "properties": { "name": { "type": "string", "description": "Updated name of the workflow" }, "description": { "type": "string", "description": "Updated description of the workflow" }, "config": { "$ref": "#/components/schemas/WorkflowConfig" }, "archived": { "type": "boolean", "description": "Whether the workflow is archived" } } }, "UpdateWorkflowResponse": { "type": "object", "properties": { "subject": { "type": "string", "description": "Subject identifier for the workflow" }, "name": { "type": "string", "description": "Name of the workflow" }, "description": { "type": "string", "description": "Description of the workflow" }, "config": { "$ref": "#/components/schemas/WorkflowConfig" }, "modified": { "$ref": "#/components/schemas/Modified" } } }, "GetCollectionResponse": { "type": "object", "required": [ "name", "topic", "subject", "sequence", "type", "modified" ], "properties": { "name": { "type": "string", "description": "Name of the collection" }, "collection_type": { "type": "string", "description": "Type of the collection (node or workflow)" }, "topic": { "type": "string", "description": "Hash of the collection name" }, "description": { "type": "string", "description": "Description of the collection" }, "subject": { "type": "string", "description": "Subject identifier for the collection" }, "sequence": { "type": "integer", "description": "The sequence number of the last message for this collection on the stream" }, "modified": { "$ref": "#/components/schemas/Modified" }, "type": { "type": "string", "description": "Last event type - created or updated", "enum": [ "created", "updated" ] } } }, "Modified": { "type": "integer", "description": "Timestamp of last modification" }, "GetNodeResponse": { "type": "object", "properties": { "subject": { "type": "string", "description": "Subject identifier for the node" }, "data": { "$ref": "#/components/schemas/NodeData" }, "modified": { "$ref": "#/components/schemas/Modified" } } }, "GetWorkflowResponse": { "type": "object", "properties": { "subject": { "type": "string", "description": "Subject identifier for the workflow" }, "name": { "type": "string", "description": "Name of the workflow" }, "description": { "type": "string", "description": "Description of the workflow" }, "config": { "$ref": "#/components/schemas/WorkflowConfig" }, "modified": { "$ref": "#/components/schemas/Modified" } } }, "ListNodesResponse": { "type": "object", "properties": { "results": { "type": "array", "items": { "type": "object", "properties": { "subject": { "type": "string", "description": "Subject identifier for the node" }, "data": { "$ref": "#/components/schemas/NodeData" }, "modified": { "$ref": "#/components/schemas/Modified" } } } }, "results_total": { "type": "integer", "description": "Total number of results" } } }, "ListWorkflowsResponse": { "type": "object", "properties": { "results": { "type": "array", "items": { "type": "object", "properties": { "subject": { "type": "string", "description": "Subject identifier for the workflow" }, "name": { "type": "string", "description": "Name of the workflow" }, "description": { "type": "string", "description": "Description of the workflow" }, "config": { "$ref": "#/components/schemas/WorkflowConfig" }, "modified": { "$ref": "#/components/schemas/Modified" } } } }, "results_total": { "type": "integer", "description": "Total number of results" } } }, "SuccessResponse": { "type": "object", "properties": { "message": { "type": "string", "description": "Success message" } } }, "ErrorResponse": { "type": "object", "properties": { "error": { "type": "string", "description": "Error message" } } }, "IntegrationOauthConfig": { "type": "object", "required": [ "integration_id", "name", "scopes", "client_id", "client_secret", "auth_url", "token_url", "redirect_url" ], "properties": { "integration_id": { "type": "string", "description": "Unique identifier for the integration" }, "name": { "type": "string", "description": "Name of the OAuth integration" }, "scopes": { "type": "string", "description": "Comma-separated list of OAuth scopes", "example": "read,write,admin" }, "client_id": { "type": "string", "description": "OAuth client ID" }, "client_secret": { "type": "string", "description": "OAuth client secret" }, "auth_url": { "type": "string", "format": "uri", "description": "Authorization URL for the OAuth flow" }, "token_url": { "type": "string", "format": "uri", "description": "Token URL to exchange authorization code for access token" }, "redirect_url": { "type": "string", "format": "uri", "description": "Redirect URL used in the OAuth flow" } } }, "OauthConfigBasicData": { "type": "object", "properties": { "integration_id": { "type": "string", "example": "slack" }, "name": { "type": "string", "example": "Slack API" }, "scopes": { "type": "string", "example": "channels:read" }, "subject": { "type": "string", "example": "ms.integration.oauth.config.slack" } }, "example": { "integration_id": "slack", "name": "Slack API", "scopes": "channels:read", "subject": "ms.integration.oauth.config.slack" } }, "OauthConfigList": { "type": "object", "properties": { "results": { "type": "array", "items": { "$ref": "#/components/schemas/OauthConfigBasicData" } }, "results_total": { "type": "integer", "example": 2 } }, "example": { "results": [ { "integration_id": "slack", "name": "Slack API", "scopes": "channels:read", "subject": "ms.integration.oauth.config.slack" }, { "integration_id": "xero", "name": "Xero API's", "scopes": "email,openid,profile,assets,assets.read,files,files.read,projects,projects.read", "subject": "ms.integration.oauth.config.xero" } ], "results_total": 2 } }, "OauthConnection": { "type": "object", "properties": { "access_token": { "type": "string", "description": "OAuth access token", "example": "eyJhbGciOiJSUzI1Ni..." }, "token_type": { "type": "string", "description": "Token type (usually Bearer)", "example": "Bearer" }, "refresh_token": { "type": "string", "description": "OAuth refresh token", "example": "ulpL_..." }, "expiry": { "type": "string", "format": "date-time", "description": "Token expiration time", "example": "2025-05-29T17:09:39.816102+01:00" }, "expires_in": { "type": "integer", "description": "Token expires in seconds", "example": 1800 }, "sequence": { "type": "integer", "description": "Message sequence number", "example": 85 }, "subject": { "type": "string", "description": "Message subject", "example": "ms.integration.oauth.AC75JGNMJHTRQNXCBDMIAJCJ57HAEWP2RGWXJCIFFGW2K64OKG267A2D.xero.demo" }, "modified": { "type": "integer", "description": "Last modified timestamp", "example": 1748533179 } }, "example": { "access_token": "eyJhbGciOiJSUzI1Ni...", "expires_in": 1800, "expiry": "2025-05-29T17:09:39.816102+01:00", "modified": 1748533179, "refresh_token": "ulpL_...", "sequence": 85, "subject": "ms.integration.oauth.AC75JGNMJHTRQNXCBDMIAJCJ57HAEWP2RGWXJCIFFGW2K64OKG267A2D.xero.demo", "token_type": "Bearer" } }, "OauthConnectionsList": { "type": "object", "properties": { "results": { "type": "array", "items": { "$ref": "#/components/schemas/OauthConnection" } }, "results_total": { "type": "integer", "example": 2 } }, "example": { "results": [ { "access_token": "eyJhbGciOiJSUzI1Ni...", "expires_in": 1800, "expiry": "2025-05-29T17:09:39.816102+01:00", "modified": 1748533179, "refresh_token": "ulpL_...", "sequence": 85, "subject": "ms.integration.oauth.AC75JGNMJHTRQNXCBDMIAJCJ57HAEWP2RGWXJCIFFGW2K64OKG267A2D.xero.demo", "token_type": "Bearer" }, { "access_token": "eyJhbGciOiJSUzI1NiIs...", "expires_in": 1800, "expiry": "2025-05-29T17:11:54.397804+01:00", "modified": 1748533314, "refresh_token": "pSn5h...", "sequence": 86, "subject": "ms.integration.oauth.AC75JGNMJHTRQNXCBDMIAJCJ57HAEWP2RGWXJCIFFGW2K64OKG267A2D.xero.maria", "token_type": "Bearer" } ], "results_total": 2 } }, "OauthLoginResponse": { "type": "object", "properties": { "oauth_url": { "type": "string", "description": "OAuth authorization URL to redirect user to", "example": "https://slack.com/oauth/v2/authorize?client_id=123456789.987654321&scope=channels:read&state=abc123xyz&redirect_uri=https://api.example.com/hub/integrations/oauth-callback" } }, "example": { "oauth_url": "https://slack.com/oauth/v2/authorize?client_id=123456789.987654321&scope=channels:read&state=abc123xyz&redirect_uri=https://api.example.com/hub/integrations/oauth-callback" } } }, "parameters": { "collectionTopic": { "name": "collection_topic", "in": "path", "description": "The topic is a hash of the name that was used when a collection was created", "required": true, "schema": { "type": "string" }, "example": "1234567890" }, "nodeTopic": { "name": "node_topic", "in": "path", "description": "Node topic - hash of the names the node was created with", "required": true, "schema": { "type": "string" }, "example": "98765432" }, "flowTopic": { "name": "flow_topic", "in": "path", "description": "Flow topic - hash of the names the node was created with", "required": true, "schema": { "type": "string" }, "example": "21312322" }, "collectionType": { "name": "collection_type", "in": "path", "description": "List only 'node' or only 'workflow' collections. If this parameter is omitted, both will be listed", "required": false, "schema": { "type": "string", "enum": [ "node", "workflow" ] }, "example": "node" }, "integrationId": { "name": "integration_id", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Integration identifier", "example": "slack" }, "connectionId": { "name": "connection_id", "in": "path", "required": true, "schema": { "type": "string" }, "description": "Connection identifier", "example": "maria" }, "queryCollectionType": { "name": "collection_type", "in": "query", "description": "List only 'node' or only 'workflow' collections. If this parameter is omitted, both will be listed", "required": false, "schema": { "type": "string", "enum": [ "node", "workflow" ] }, "example": "node" }, "queryDraftFlag": { "name": "draft", "in": "query", "description": "Draft flag", "required": false, "schema": { "type": "boolean" }, "example": true } }, "securitySchemes": { "bearerAuth": { "type": "http", "scheme": "bearer", "bearerFormat": "JWT", "description": "JWT Authorization header using the Bearer scheme" }, "apiKeyAuth": { "type": "apiKey", "in": "header", "name": "X-Api-Key" } } }, "security": [ { "bearerAuth": [] }, { "apiKeyAuth": [] } ], "tags": [ { "name": "Collections", "description": "Operations related to collections" }, { "name": "Nodes", "description": "Operations related to nodes" }, { "name": "Workflows", "description": "Operations related to workflows" }, { "name": "Oauth", "description": "Oauth configurations and connections" } ] }