arazzo: 1.0.1 info: title: YouTube Discover and Comment summary: Search for a video, confirm its details, then post a top-level comment on it. description: >- A discover-then-engage flow. It searches YouTube for a video, confirms the top result by reading the video resource, and then posts a new top-level comment on that video. Every step spells out its request inline so the flow can be read and executed without opening the underlying OpenAPI description. version: 1.0.0 sourceDescriptions: - name: youtubeDataApi url: ../openapi/youtube-data-api-openapi.yml type: openapi workflows: - workflowId: discover-and-comment summary: Find a video by query and post a comment on it. description: >- Searches for a video, reads its full resource to confirm it, and posts a new top-level comment thread on that video. inputs: type: object required: - apiKey - query - commentText properties: apiKey: type: string description: The Google API key used to authorize each YouTube Data API request. query: type: string description: The query term used to find a video. commentText: type: string description: The text of the top-level comment to post. steps: - stepId: searchVideos description: Search YouTube restricted to video resources and capture the first video id. operationId: youtube.search.list parameters: - name: part in: query value: snippet - name: q in: query value: $inputs.query - name: type in: query value: video - name: maxResults in: query value: 5 - name: key in: query value: $inputs.apiKey successCriteria: - condition: $statusCode == 200 outputs: videoId: $response.body#/items/0/id/videoId - stepId: confirmVideo description: Read the matched video resource to confirm it exists before commenting. operationId: youtube.videos.list parameters: - name: part in: query value: snippet - name: id in: query value: $steps.searchVideos.outputs.videoId - name: key in: query value: $inputs.apiKey successCriteria: - condition: $statusCode == 200 outputs: title: $response.body#/items/0/snippet/title - stepId: postComment description: Post a new top-level comment thread on the confirmed video. operationId: youtube.commentThreads.insert parameters: - name: part in: query value: snippet - name: key in: query value: $inputs.apiKey requestBody: contentType: application/json payload: snippet: videoId: $steps.searchVideos.outputs.videoId topLevelComment: snippet: textOriginal: $inputs.commentText successCriteria: - condition: $statusCode == 200 outputs: threadId: $response.body#/id outputs: videoId: $steps.searchVideos.outputs.videoId title: $steps.confirmVideo.outputs.title threadId: $steps.postComment.outputs.threadId