Cross-Provider Workflow

TikTok Research Videos to Airtable and SendGrid Report

Version 1.0.0

Query the TikTok Research API for videos, log them to Airtable, then email a report via SendGrid.

1 workflow 3 source APIs 3 providers
View Spec View on GitHub ArazzoWorkflowsCross-Provider

Providers Orchestrated

tiktok-for-developers airtable sendgrid

Workflows

tiktok-research-to-report
Query TikTok research videos, log to Airtable, email a SendGrid report.
Queries the TikTok Research API for videos, records a summary in Airtable, then emails an analyst a report referencing the new record via SendGrid.
3 steps inputs: analystEmail, baseId, query, tableIdOrName outputs: emailStatus, recordId, videos
1
query-research
$sourceDescriptions.tiktokResearchApi.queryResearchVideos
Query the TikTok Research API for matching videos.
2
log-to-airtable
$sourceDescriptions.airtableApi.createRecords
Record a summary of the research videos in Airtable.
3
email-report
$sourceDescriptions.sendgridApi.SendMail
Email the analyst a research report via SendGrid.

Source API Descriptions

Arazzo Workflow Specification

soc-tiktok-research-videos-to-airtable-sendgrid-report-workflow.yml Raw ↑
arazzo: 1.0.1
info:
  title: TikTok Research Videos to Airtable and SendGrid Report
  summary: Query the TikTok Research API for videos, log them to Airtable, then email a report via SendGrid.
  description: >-
    A research workflow that queries the TikTok Research API for videos matching
    criteria, records a summary in an Airtable base, and emails an analyst a
    report through SendGrid Mail Send. Demonstrates moving research data from a
    social platform into a database and distributing it by email in one Arazzo
    workflow.
  version: 1.0.0
sourceDescriptions:
  - name: tiktokResearchApi
    url: https://raw.githubusercontent.com/api-evangelist/tiktok-for-developers/refs/heads/main/openapi/tiktok-research-openapi.yml
    type: openapi
  - name: airtableApi
    url: https://raw.githubusercontent.com/api-evangelist/airtable/refs/heads/main/openapi/airtable-airtable-api-openapi.yml
    type: openapi
  - name: sendgridApi
    url: https://raw.githubusercontent.com/api-evangelist/sendgrid/refs/heads/main/openapi/tsg_mail_v3.yaml
    type: openapi
workflows:
  - workflowId: tiktok-research-to-report
    summary: Query TikTok research videos, log to Airtable, email a SendGrid report.
    description: >-
      Queries the TikTok Research API for videos, records a summary in Airtable,
      then emails an analyst a report referencing the new record via SendGrid.
    inputs:
      type: object
      properties:
        query:
          type: object
        baseId:
          type: string
        tableIdOrName:
          type: string
        analystEmail:
          type: string
    steps:
      - stepId: query-research
        description: Query the TikTok Research API for matching videos.
        operationId: $sourceDescriptions.tiktokResearchApi.queryResearchVideos
        requestBody:
          contentType: application/json
          payload:
            query: $inputs.query
            max_count: 20
        successCriteria:
          - condition: $statusCode == 200
        outputs:
          videos: $response.body#/data/videos
      - stepId: log-to-airtable
        description: Record a summary of the research videos in Airtable.
        operationId: $sourceDescriptions.airtableApi.createRecords
        requestBody:
          contentType: application/json
          payload:
            records:
              - fields:
                  Source: TikTok Research
                  ResultSummary: $steps.query-research.outputs.videos
        successCriteria:
          - condition: $statusCode == 200
        outputs:
          recordId: $response.body#/records/0/id
      - stepId: email-report
        description: Email the analyst a research report via SendGrid.
        operationId: $sourceDescriptions.sendgridApi.SendMail
        requestBody:
          contentType: application/json
          payload:
            personalizations:
              - to:
                  - email: $inputs.analystEmail
                subject: TikTok research report ready
            from:
              email: [email protected]
            content:
              - type: text/plain
                value: Research results logged to Airtable record $steps.log-to-airtable.outputs.recordId
        successCriteria:
          - condition: $statusCode == 202
        outputs:
          emailStatus: $statusCode
    outputs:
      videos: $steps.query-research.outputs.videos
      recordId: $steps.log-to-airtable.outputs.recordId
      emailStatus: $steps.email-report.outputs.emailStatus