Amazon EC2 · Arazzo Workflow

Amazon EC2 Inventory Instances Then Image First

Version 1.0.0

Describe instances, page through with NextToken, then image the first instance found.

1 workflow 2 source APIs 1 provider
View Spec View on GitHub Cloud ComputingComputeInfrastructure-as-a-ServiceInfrastructureVirtual MachinesArazzoWorkflows

Provider

amazon-ec2

Workflows

paginate-instances-then-image
Page through described instances and image the first one found.
Chains a DescribeInstances pagination loop branching on the NextToken cursor with a CreateImage call against the first discovered instance.
2 steps inputs: imageName, maxResults outputs: imageId
1
pageInstances
Describe instances and branch on the NextToken cursor, looping while more pages remain and proceeding once the listing is complete.
2
imageFirst
Create an AMI from the first instance discovered during paging.

Source API Descriptions

Arazzo Workflow Specification

Raw ↑
arazzo: 1.0.1
info:
  title: Amazon EC2 Inventory Instances Then Image First
  summary: Describe instances, page through with NextToken, then image the first instance found.
  description: >-
    Builds an instance inventory and captures an image of the first instance it
    finds. The workflow describes instances, follows the NextToken pagination
    cursor by looping while a token is present, and once paging is complete
    creates an AMI from the first discovered instance. The pagination step
    branches on whether a NextToken remains. Every step spells out its request
    inline using the Amazon EC2 query protocol (Action and Version parameters) so
    the flow can be read and executed without opening the underlying OpenAPI
    description.
  version: 1.0.0
sourceDescriptions:
- name: amisApi
  url: ../openapi/amazon-ec2-amis-api-openapi.yml
  type: openapi
- name: instancesApi
  url: ../openapi/amazon-ec2-instances-api-openapi.yml
  type: openapi
workflows:
- workflowId: paginate-instances-then-image
  summary: Page through described instances and image the first one found.
  description: >-
    Chains a DescribeInstances pagination loop branching on the NextToken cursor
    with a CreateImage call against the first discovered instance.
  inputs:
    type: object
    required:
    - imageName
    properties:
      imageName:
        type: string
        description: A name for the AMI captured from the first discovered instance.
      maxResults:
        type: integer
        description: The maximum number of instances to return per page.
        default: 100
  steps:
  - stepId: pageInstances
    description: >-
      Describe instances and branch on the NextToken cursor, looping while more
      pages remain and proceeding once the listing is complete.
    operationId: describeInstances
    parameters:
    - name: Action
      in: query
      value: DescribeInstances
    - name: Version
      in: query
      value: '2016-11-15'
    - name: MaxResults
      in: query
      value: $inputs.maxResults
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      nextToken: $response.body#/nextToken
      firstInstanceId: $response.body#/reservationSet/0/instancesSet/0/instanceId
    onSuccess:
    - name: morePages
      type: goto
      stepId: pageInstances
      criteria:
      - context: $response.body
        condition: $.nextToken != null && $.nextToken != ''
        type: jsonpath
    - name: lastPage
      type: goto
      stepId: imageFirst
      criteria:
      - context: $response.body
        condition: $.nextToken == null || $.nextToken == ''
        type: jsonpath
  - stepId: imageFirst
    description: Create an AMI from the first instance discovered during paging.
    operationId: createImage
    parameters:
    - name: Action
      in: query
      value: CreateImage
    - name: Version
      in: query
      value: '2016-11-15'
    - name: InstanceId
      in: query
      value: $steps.pageInstances.outputs.firstInstanceId
    - name: Name
      in: query
      value: $inputs.imageName
    - name: NoReboot
      in: query
      value: true
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      imageId: $response.body#/imageId
  outputs:
    imageId: $steps.imageFirst.outputs.imageId

Work with this as data

Every workflow here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for arazzo workflows

4 MCP tools reach this
  • find_arazzoBrowse and filter every workflow in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This workflow
curl "https://apis.io/api/v1/arazzo/amazon-ec2-paginate-instances-then-tag-image-workflow"
All arazzo workflows
curl "https://apis.io/api/v1/arazzo?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.