arazzo: 1.0.1 info: title: SendGrid Create and Schedule Campaign summary: Create a legacy Marketing Campaign targeting lists and schedule it for delivery. description: >- Drives a legacy Marketing Campaign from draft to scheduled. The workflow creates a campaign with a title, subject, sender, recipient list IDs, suppression group, and HTML content, then schedules it for delivery at a Unix timestamp. The create returns 201 and the schedule returns 201 with the campaign status. Each step inlines its request and bearer token so the flow can be read and run without the OpenAPI files. version: 1.0.0 sourceDescriptions: - name: campaignsApi url: ../openapi/tsg_lmc_campaigns_v3.yaml type: openapi workflows: - workflowId: create-and-schedule-campaign summary: Create a campaign targeting lists and schedule it for delivery. description: >- Creates a campaign with content and recipients, then schedules it at the supplied send time. inputs: type: object required: - apiKey - title - subject - senderId - listIds - suppressionGroupId - htmlContent - plainContent - sendAt properties: apiKey: type: string description: SendGrid API key sent as a bearer token. title: type: string description: The internal title of the campaign. subject: type: string description: The subject line of the campaign. senderId: type: integer description: The ID of the sender used as the from address. listIds: type: array description: The recipient list IDs the campaign targets. items: type: integer suppressionGroupId: type: integer description: The unsubscribe suppression group ID. htmlContent: type: string description: The HTML content of the campaign. plainContent: type: string description: The plain text content of the campaign. sendAt: type: integer description: The Unix timestamp at which to send the campaign. steps: - stepId: createCampaign description: Create a campaign with content and recipient lists. operationId: CreateCampaign parameters: - name: Authorization in: header value: "Bearer $inputs.apiKey" requestBody: contentType: application/json payload: title: $inputs.title subject: $inputs.subject sender_id: $inputs.senderId list_ids: $inputs.listIds suppression_group_id: $inputs.suppressionGroupId html_content: $inputs.htmlContent plain_content: $inputs.plainContent successCriteria: - condition: $statusCode == 201 outputs: campaignId: $response.body#/id - stepId: scheduleCampaign description: Schedule the campaign for delivery at the supplied send time. operationId: ScheduleCampaign parameters: - name: Authorization in: header value: "Bearer $inputs.apiKey" - name: campaign_id in: path value: $steps.createCampaign.outputs.campaignId requestBody: contentType: application/json payload: send_at: $inputs.sendAt successCriteria: - condition: $statusCode == 201 outputs: status: $response.body#/status sendAt: $response.body#/send_at outputs: campaignId: $steps.createCampaign.outputs.campaignId status: $steps.scheduleCampaign.outputs.status sendAt: $steps.scheduleCampaign.outputs.sendAt