X (Twitter) · Arazzo Workflow

X List Who Reposted a Handle's Latest Post

Version 1.0.0

Resolve a handle, get their latest post, then list who reposted it.

1 workflow 1 source API 1 provider
View Spec View on GitHub Social MediaMicrobloggingReal-Time DataStreamingAdvertisingContentArazzoWorkflows

Provider

twitter

Workflows

reposters-of-latest-post
Resolve a user, fetch their latest post, and list its reposters.
Chains the username lookup endpoint into the user-posts endpoint and then the reposted-by endpoint, branching to a no-op end when the user has no posts.
3 steps inputs: authorization, username outputs: latestPostId, reposters, userId
1
resolveUser
getUsersByUsername
Resolve the username into a numeric user id.
2
latestPost
getUsersPosts
Retrieve the single most recent original post for the resolved user.
3
repostedBy
getPostsRepostedBy
List the users who reposted the resolved user's latest post.

Source API Descriptions

Arazzo Workflow Specification

twitter-reposters-of-latest-post-workflow.yml Raw ↑
arazzo: 1.0.1
info:
  title: X List Who Reposted a Handle's Latest Post
  summary: Resolve a handle, get their latest post, then list who reposted it.
  description: >-
    Produces a repost audit for an X account. The workflow resolves a username
    to an id, retrieves that user's single most recent post, and then lists the
    users who reposted that post. Each step inlines its field selections so the
    chain reads and executes without opening the underlying OpenAPI description.
  version: 1.0.0
sourceDescriptions:
- name: xApi
  url: ../openapi/x-api-openapi.json
  type: openapi
workflows:
- workflowId: reposters-of-latest-post
  summary: Resolve a user, fetch their latest post, and list its reposters.
  description: >-
    Chains the username lookup endpoint into the user-posts endpoint and then
    the reposted-by endpoint, branching to a no-op end when the user has no
    posts.
  inputs:
    type: object
    required:
    - username
    properties:
      username:
        type: string
        description: The @username to audit, without the leading @.
      authorization:
        type: string
        description: Bearer token to authorize the requests (e.g. "Bearer xxx").
  steps:
  - stepId: resolveUser
    description: Resolve the username into a numeric user id.
    operationId: getUsersByUsername
    parameters:
    - name: username
      in: path
      value: $inputs.username
    - name: user.fields
      in: query
      value: id,name,username
    - name: Authorization
      in: header
      value: $inputs.authorization
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      userId: $response.body#/data/id
  - stepId: latestPost
    description: Retrieve the single most recent original post for the resolved user.
    operationId: getUsersPosts
    parameters:
    - name: id
      in: path
      value: $steps.resolveUser.outputs.userId
    - name: max_results
      in: query
      value: 5
    - name: exclude
      in: query
      value: replies,retweets
    - name: tweet.fields
      in: query
      value: id,text,public_metrics
    - name: Authorization
      in: header
      value: $inputs.authorization
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      latestPostId: $response.body#/data/0/id
    onSuccess:
    - name: hasPosts
      type: goto
      stepId: repostedBy
      criteria:
      - context: $response.body
        condition: $.data.length > 0
        type: jsonpath
    - name: noPosts
      type: end
      criteria:
      - context: $response.body
        condition: $.data.length == 0
        type: jsonpath
  - stepId: repostedBy
    description: List the users who reposted the resolved user's latest post.
    operationId: getPostsRepostedBy
    parameters:
    - name: id
      in: path
      value: $steps.latestPost.outputs.latestPostId
    - name: max_results
      in: query
      value: 100
    - name: user.fields
      in: query
      value: id,name,username
    - name: Authorization
      in: header
      value: $inputs.authorization
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      reposters: $response.body#/data
      resultCount: $response.body#/meta/result_count
  outputs:
    userId: $steps.resolveUser.outputs.userId
    latestPostId: $steps.latestPost.outputs.latestPostId
    reposters: $steps.repostedBy.outputs.reposters