---
title: "Create or update workflow specification"
method: PUT
path: "/workflow-specs/{workflowSpecId}"
tags: ["WorkflowSpecs"]
---

# Create or update workflow specification

`PUT /workflow-specs/{workflowSpecId}`

Create or update workflow specification. The request must contain all the computation specifications which are to make up the workflow specification. These computation specifications must have previously been created. The request must also contain all the edges which connect the computation specifications together. The edges describe the flow of data from one computation specifications output data-type to another computation specifications input data-type. As an example, a workflow specification could consist of two computation specifications connected together. The connection between the two computation specifications could consist of the first output data-type from the first computation specification being connected to the first input data-type of the second computation specification. If the two computation specifications being connected together were the 'ix' and 'peep' computation specifications, the output data-type 'production-forecast' of the 'ix' computation specification would be connected to the input data-type 'production-forecast' of the 'peep' computation specification. As the 'production-forecast' data-type is the first output data-type (zeroth index) in the 'ix' computation specification and the first input data-type (zeroth index) in the 'peep' computation specification, the workflow edge would be defined as going from the index zero output data-type of the computation specification with index zero (the 'ix' computation specification) to  the index zero output data-type of the computation index with index one (the 'peep' computation index). The order of the computation specifications provided in the creation of the workflow specification is maintained in the created workflow specification and may be changed through performing PATCH or PUT operations on the workflow specification.

## Path parameters

- `workflowSpecId` string, required

## Headers

- `slb-data-partition-id` string, required

## Request body

- ReplaceWorkflowSpec — Replace workflow specification request.
  - `id` string, required — The id of the specification. The id should be of the form '{authority}:{spec-type}:{id}', where '{authority}' is the owning authority of the specification, '{spec-type}' is one of 'data-types', 'computation-specs' or 'workflow-specs'.
  - `name` string, required — The name of the specification.
  - `version` integer, required — The version of the specification definition.
  - `archived` boolean — Whether this specification has been marked as archived.
  - `description` string, required — The description of the specification.
  - `computationSpecs` VersionId[], required — The computation specifications which make up the workflow specification. These computation specifications must have already been previously created. The order of the computation specifications is maintained in the created/updated workflow specification.
    - `id` string, required — The specification ID.
    - `version` integer, required — The version of the specification of the given ID.
  - `edges` Edge[] — A list of edges which describe all the links in the workflow specification. The edges describe the flow of data from one computation specifications output data-type to another computation specifications input data-type. The computation specifications referred to in the edges must have been previously created and be defined in the computationSpecIds property.
    - `fromAddressType` 'DataTypeInput' | 'DataTypeOutput' — Whether the address refers to a data-type input or data-type output (defaults to output).
    - `fromComputationIndex` integer — The zero based index of the computation specification which generates the data-type in the workflow specification.
    - `fromDataTypeIndex` integer — The zero based index of the data-type as listed as an output data-type in computation specification referred to in the 'fromComputationIndex' above.
    - `toComputationIndex` integer — The zero based index of the computation specification which consumes the data-type in the workflow specification.
    - `toDataTypeIndex` integer — The zero based index of the data-type as listed as an input data-type in the computation specification referred to in the 'toComputationIndex' above.
  - `annotations` Annotation[]
    - `address` SpecAddress — An address used to describe the location of a Spec within a WorkflowSpec. Used to enrich the spec model with additional attributes such as specifying the location of a data container or providing annotations.
      - `type` 'Invalid' | 'Computation' | 'DataTypeInput' | 'DataTypeOutput', required — Whether the address refers to a data-type input, a data-type output or a computation specification.
      - `computationIndex` integer — The zero based index of the Computation Spec.
      - `dataTypeIndex` integer — The zero based index of a data-type with respect to a computation specification. Inputs and outputs are treated as separate ordered lists.
    - `key` string — Free form content with relevant information for the given address.
    - `value` string — Free form content with relevant information for the given address.
    - `createdBy` string — The user who created this annotation.

## Response `200`

Workflow specification updated successfully.

- WorkflowSpec — An evaluation workflow specification.
  - `id` string, required — The ID of the specification.
  - `name` string, required — The name of the specification.
  - `version` integer, required — The version of the specification definition.
  - `latest` boolean, required — Whether this is the latest version of the given specification.
  - `archived` boolean, required — Whether this specification has been marked as archived.
  - `description` string, required — The description of the specification.
  - `createdBy` string, required — The ID of the user who created the specification.
  - `createdAt` string, date-time, required — The date the specification was created.
  - `computationSpecs` WorkflowComputationSpec[], required — The computation specifications which make up the workflow specification.
    - `id` string, required — The ID of the specification.
    - `name` string, required — The name of the specification.
    - `version` integer, required — The version of the specification definition.
    - `latest` boolean, required — Whether this is the latest version of the given specification.
    - `archived` boolean, required — Whether this specification has been marked as archived.
    - `description` string, required — The description of the specification.
    - `createdBy` string, required — The ID of the user who created the specification.
    - `createdAt` string, date-time, required — The date the specification was created.
    - `address` SpecAddress — An address used to describe the location of a Spec within a WorkflowSpec. Used to enrich the spec model with additional attributes such as specifying the location of a data container or providing annotations.
      - `type` 'Invalid' | 'Computation' | 'DataTypeInput' | 'DataTypeOutput', required — Whether the address refers to a data-type input, a data-type output or a computation specification.
      - `computationIndex` integer — The zero based index of the Computation Spec.
      - `dataTypeIndex` integer — The zero based index of a data-type with respect to a computation specification. Inputs and outputs are treated as separate ordered lists.
    - `inputDataTypeIds` WorkflowDataType[] — The input data-types for the computation.
      - `id` string, required — The specification ID.
      - `version` integer, required — The version of the specification of the given ID.
      - `address` SpecAddress — An address used to describe the location of a Spec within a WorkflowSpec. Used to enrich the spec model with additional attributes such as specifying the location of a data container or providing annotations.
        - `type` 'Invalid' | 'Computation' | 'DataTypeInput' | 'DataTypeOutput', required — Whether the address refers to a data-type input, a data-type output or a computation specification.
        - `computationIndex` integer — The zero based index of the Computation Spec.
        - `dataTypeIndex` integer — The zero based index of a data-type with respect to a computation specification. Inputs and outputs are treated as separate ordered lists.
    - `outputDataTypeIds` WorkflowDataType[] — The output data-types for the computation.
      - `id` string, required — The specification ID.
      - `version` integer, required — The version of the specification of the given ID.
      - `address` SpecAddress — An address used to describe the location of a Spec within a WorkflowSpec. Used to enrich the spec model with additional attributes such as specifying the location of a data container or providing annotations.
        - `type` 'Invalid' | 'Computation' | 'DataTypeInput' | 'DataTypeOutput', required — Whether the address refers to a data-type input, a data-type output or a computation specification.
        - `computationIndex` integer — The zero based index of the Computation Spec.
        - `dataTypeIndex` integer — The zero based index of a data-type with respect to a computation specification. Inputs and outputs are treated as separate ordered lists.
  - `edges` Edge[] — A list of graph edges which describe the data flow from one computation specifications output data-type to the next computation specifications input data-type.
    - `fromAddressType` 'DataTypeInput' | 'DataTypeOutput' — Whether the address refers to a data-type input or data-type output (defaults to output).
    - `fromComputationIndex` integer — The zero based index of the computation specification which generates the data-type in the workflow specification.
    - `fromDataTypeIndex` integer — The zero based index of the data-type as listed as an output data-type in computation specification referred to in the 'fromComputationIndex' above.
    - `toComputationIndex` integer — The zero based index of the computation specification which consumes the data-type in the workflow specification.
    - `toDataTypeIndex` integer — The zero based index of the data-type as listed as an input data-type in the computation specification referred to in the 'toComputationIndex' above.
  - `annotations` Annotation[]
    - `address` SpecAddress — An address used to describe the location of a Spec within a WorkflowSpec. Used to enrich the spec model with additional attributes such as specifying the location of a data container or providing annotations.
      - `type` 'Invalid' | 'Computation' | 'DataTypeInput' | 'DataTypeOutput', required — Whether the address refers to a data-type input, a data-type output or a computation specification.
      - `computationIndex` integer — The zero based index of the Computation Spec.
      - `dataTypeIndex` integer — The zero based index of a data-type with respect to a computation specification. Inputs and outputs are treated as separate ordered lists.
    - `key` string — Free form content with relevant information for the given address.
    - `value` string — Free form content with relevant information for the given address.
    - `createdBy` string — The user who created this annotation.

## Other responses

- `201` — Workflow specification created successfully.
- `400` — Unauthorized.
- `401` — Unauthorized.
- `default` — Unexpected error.

---

[API](https://skmtc.net/slb/apis/evaluation.md) · [All operations](https://skmtc.net/slb/apis/evaluation/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/slb/evaluation/versions/b563a2fae7de/schema)
