Speakeasy Workflow File
Tip
For most use cases we recommend interacting with the Speakeasy workflow file (workflow.yaml
) through the speakeasy configure
command.
This command has subcommands to configure sources, targets, github setup and package publishing. All new targets created through speakeasy quickstart
will automatically have a workflow
file created in the .speakeasy/
folder in the root of their target directory.
For editing the workflow file manually, Speakeasy’s VSCode extension
The workflow file is a file that dictates how the Speakeasy CLI will interact with sources and targets. The interaction is modelled as a workflow between sources and targets. A Source is one or more OpenAPI documents and Overlays merged together to create a single OpenAPI documents. A Target is a SDK, Terraform or other generated artifact from sources.
File Structure
Speakeasy Version
The version of the Speakeasy CLI to use to run the workflow. The version can be a specific version or latest
to use the latest version.
Pinning to a specific version can be useful to ensure that the workflow runs consistently across different environments.
Sources
Sources can be added to a workflow programmatically speakeasy configure sources
or manually by editing the workflow file.
Sources
Sources are the inputs to the workflow. A single Source is one or more OpenAPI documents and Overlays that are merged together to create a single OpenAPI document.
SourceName
Each Source is given a name. In this example the name is my-source
. This name is used to reference the source in the workflow file.
Inputs
Each Source has a list of inputs. Each input is an OpenAPI document or Overlay. The OpenAPI documents and Overlays are merged together to create a single OpenAPI document.
Location
Each input has a location. The location is the path to the OpenAPI document or Overlay. The path can be a local reference or a remote URL. If a URL is a used authentication may need to be provided.
Transformations
Sources can include transformations that modify the OpenAPI document before it’s used to generate SDKs. Transformations are applied in order after merging inputs and applying overlays.
Output
Each source can specify an output location where the merged OpenAPI document will be written.
Registry
Sources can be configured to publish to the API Registry found in the Speakeasy workspace.
Targets
Targets can be added to a workflow programmatically speakeasy configure targets
or manually by editing the workflow file.
Targets
Targets are the outputs of the workflow. A single Target is a SDK, Terraform or other generated artifact from sources.
TargetName
Each Target is given a name. In this example the name is my-target
. This name is used to reference the target in the workflow file.
TargetType
Each Target has a type. The target is the type of artifact that will be generated from the sources. The target can be one of the supported languages here
TargetSource
Each Target has a source. The source is the name of the source that the target will be generated from.
Testing
Each Target supports enabling testing as part of the workflow, if test generation is licensed. This will run target-specific testing, such as go test
or pytest
, after code generation. Use this with CLI-only speakeasy run
development workflows (instead of separately calling speakeasy test
) or GitHub Actions mode: direct
or mode: test
development workflows to ensure tests are successful with any potential code updates.
MockServer
Target testing, when licensed and enabled, starts a mock API server automatically as part of the workflow. This disables the mock API server, if the testing should always pointed at a test environment server URL instead.
CodeSamples
Each target can be configured to generate code samples and publish them to Speakeasy’s registry.
Last updated on