arazzo: 1.0.1 info: title: Google Forms Create and Publish a Form summary: Create a form, add its questions in a batch update, publish it, and read back the responder link. description: >- The core Google Forms integration pattern. A form is created with its title only, because the create call accepts nothing else, and the description and every question are then applied in a single batch update guarded by the revision id returned at creation. The form is published and opened for responses, and the flow finishes by reading the form back to hand the caller the responder URI it needs to distribute. 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: googleFormsApi url: ../openapi/google-forms-api.yaml type: openapi workflows: - workflowId: create-and-publish-form summary: Stand up a new Google Form end to end and return its shareable responder link. description: >- Creates the form, applies the description and a satisfaction scale question plus a free-text comments question in one batch update, sets the publish settings so the form accepts responses, and reads the form back for the responder URI and final revision id. inputs: type: object required: - title - description - satisfactionQuestionTitle - commentsQuestionTitle properties: title: type: string description: The title of the form shown to responders (e.g. "Customer Feedback Survey"). description: type: string description: The description shown under the form title. satisfactionQuestionTitle: type: string description: The title of the 1-5 satisfaction scale question. commentsQuestionTitle: type: string description: The title of the free-text comments question. steps: - stepId: createForm description: >- Create the form. Only info.title is honored at creation time; the description and all items are added by the batch update that follows. operationId: createForm requestBody: contentType: application/json payload: info: title: $inputs.title successCriteria: - condition: $statusCode == 200 outputs: formId: $response.body#/formId revisionId: $response.body#/revisionId - stepId: addQuestions description: >- Apply the description and both questions in a single batch update. The revision id from the create call is supplied as write control so the update is rejected if the form changed underneath this flow. operationId: batchUpdateForm parameters: - name: formId in: path value: $steps.createForm.outputs.formId requestBody: contentType: application/json payload: includeFormInResponse: true writeControl: requiredRevisionId: $steps.createForm.outputs.revisionId requests: - updateFormInfo: info: description: $inputs.description updateMask: description - createItem: item: title: $inputs.satisfactionQuestionTitle questionItem: question: required: true scaleQuestion: low: 1 high: 5 lowLabel: Not Satisfied highLabel: Very Satisfied location: index: 0 - createItem: item: title: $inputs.commentsQuestionTitle questionItem: question: required: false textQuestion: paragraph: true location: index: 1 successCriteria: - condition: $statusCode == 200 outputs: scaleItemId: $response.body#/replies/1/createItem/itemId commentsItemId: $response.body#/replies/2/createItem/itemId revisionId: $response.body#/writeControl/targetRevisionId - stepId: publishForm description: >- Publish the form and open it for responses so the responder URI becomes usable by the people receiving it. operationId: setPublishSettings parameters: - name: formId in: path value: $steps.createForm.outputs.formId requestBody: contentType: application/json payload: publishSettings: isPublished: true isAcceptingResponses: true successCriteria: - condition: $statusCode == 200 outputs: isPublished: $response.body#/isPublished isAcceptingResponses: $response.body#/isAcceptingResponses - stepId: readBackForm description: >- Read the finished form back to capture the responder URI to distribute and the revision id to carry into any later edit. operationId: getForm parameters: - name: formId in: path value: $steps.createForm.outputs.formId successCriteria: - condition: $statusCode == 200 outputs: responderUri: $response.body#/responderUri revisionId: $response.body#/revisionId linkedSheetId: $response.body#/linkedSheetId outputs: formId: $steps.createForm.outputs.formId responderUri: $steps.readBackForm.outputs.responderUri revisionId: $steps.readBackForm.outputs.revisionId