WeatherAPI · Arazzo Workflow

WeatherAPI Forecast with Astronomy

Version 1.0.0

Resolve a location, pull a multi-day forecast, then enrich it with astronomy for the same date.

1 workflow 1 source API 1 provider
View Spec View on GitHub WeatherForecastHistoryMarineAstronomyGeolocationSportsAlertsPublic APIsArazzoWorkflows

Provider

weatherapi

Workflows

forecast-with-astronomy
Search a location, fetch its forecast, and add astronomy for a date.
Resolves the query into a location, retrieves a multi-day forecast for it, and then layers on astronomy data (sun and moon) for the supplied date.
3 steps inputs: date, days, query outputs: forecastDays, locationName, moonPhase, sunrise, sunset
1
searchLocation
searchLocations
Resolve the free-text query into the best matching location.
2
getForecast
getForecast
Retrieve a multi-day forecast for the resolved location, including the embedded daily astronomy block.
3
getAstronomy
getAstronomy
Add sunrise, sunset, moonrise, moonset, and moon phase detail for the resolved location on the requested date.

Source API Descriptions

Arazzo Workflow Specification

weatherapi-forecast-with-astronomy-workflow.yml Raw ↑
arazzo: 1.0.1
info:
  title: WeatherAPI Forecast with Astronomy
  summary: Resolve a location, pull a multi-day forecast, then enrich it with astronomy for the same date.
  description: >-
    Builds a complete daily planning view for a place. The query is resolved via
    autocomplete search, a multi-day forecast (including astronomy fields) is
    retrieved for the matched location, and a dedicated astronomy call adds
    sunrise, sunset, and moon detail for the requested date. 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: weatherApi
  url: ../openapi/weatherapi-openapi-original.yml
  type: openapi
workflows:
- workflowId: forecast-with-astronomy
  summary: Search a location, fetch its forecast, and add astronomy for a date.
  description: >-
    Resolves the query into a location, retrieves a multi-day forecast for it,
    and then layers on astronomy data (sun and moon) for the supplied date.
  inputs:
    type: object
    required:
    - query
    - days
    - date
    properties:
      query:
        type: string
        description: Partial city name, postcode, or coordinates to search for.
      days:
        type: integer
        description: Number of forecast days to return (1-14, plan dependent).
      date:
        type: string
        description: Date in yyyy-MM-dd format for the astronomy lookup.
  steps:
  - stepId: searchLocation
    description: Resolve the free-text query into the best matching location.
    operationId: searchLocations
    parameters:
    - name: q
      in: query
      value: $inputs.query
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      matchedId: $response.body#/0/id
      matchedName: $response.body#/0/name
  - stepId: getForecast
    description: >-
      Retrieve a multi-day forecast for the resolved location, including the
      embedded daily astronomy block.
    operationId: getForecast
    parameters:
    - name: q
      in: query
      value: id:$steps.searchLocation.outputs.matchedId
    - name: days
      in: query
      value: $inputs.days
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      locationName: $response.body#/location/name
      forecastDays: $response.body#/forecast/forecastday
  - stepId: getAstronomy
    description: >-
      Add sunrise, sunset, moonrise, moonset, and moon phase detail for the
      resolved location on the requested date.
    operationId: getAstronomy
    parameters:
    - name: q
      in: query
      value: id:$steps.searchLocation.outputs.matchedId
    - name: dt
      in: query
      value: $inputs.date
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      sunrise: $response.body#/astronomy/astro/sunrise
      sunset: $response.body#/astronomy/astro/sunset
      moonPhase: $response.body#/astronomy/astro/moon_phase
  outputs:
    locationName: $steps.getForecast.outputs.locationName
    forecastDays: $steps.getForecast.outputs.forecastDays
    sunrise: $steps.getAstronomy.outputs.sunrise
    sunset: $steps.getAstronomy.outputs.sunset
    moonPhase: $steps.getAstronomy.outputs.moonPhase