Storyblok · Arazzo Workflow

Storyblok Author and Publish Story

Version 1.0.0

Create a draft story, read it back, update its content, then publish it.

1 workflow 1 source API 1 provider
View Spec View on GitHub CMSContent DeliveryContent ManagementHeadless CMSImage OptimizationREST APIVisual EditorWebhooksArazzoWorkflows

Provider

storyblok

Workflows

author-and-publish-story
Create, read, update, and publish a story in one flow.
Walks a story through its editorial states — draft creation, read-back, content revision, and publication — within a single space.
4 steps inputs: componentType, initialContent, revisedContent, space_id, storyName, storySlug outputs: publishedAt, publishedStoryId, storyId
1
createStory
createStory
Create the draft story with its initial content.
2
getStory
getManagementStory
Read the story back by its numeric ID to confirm its persisted state.
3
updateStory
updateStory
Update the story with revised content, preserving its name and slug from the read-back step.
4
publishStory
publishStory
Publish the updated story so it goes live in the Content Delivery API.

Source API Descriptions

Arazzo Workflow Specification

storyblok-author-and-publish-story-workflow.yml Raw ↑
arazzo: 1.0.1
info:
  title: Storyblok Author and Publish Story
  summary: Create a draft story, read it back, update its content, then publish it.
  description: >-
    The full editorial lifecycle for a single story. A draft story is created,
    retrieved to confirm its persisted state, updated with revised content,
    and finally published so it goes live through the Content Delivery API.
    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: managementApi
  url: ../openapi/storyblok-management-api-openapi.yml
  type: openapi
workflows:
- workflowId: author-and-publish-story
  summary: Create, read, update, and publish a story in one flow.
  description: >-
    Walks a story through its editorial states — draft creation, read-back,
    content revision, and publication — within a single space.
  inputs:
    type: object
    required:
    - space_id
    - storyName
    - storySlug
    - componentType
    - initialContent
    - revisedContent
    properties:
      space_id:
        type: integer
        description: Numeric ID of the Storyblok space.
      storyName:
        type: string
        description: Display name of the story.
      storySlug:
        type: string
        description: URL-safe slug segment for the story.
      componentType:
        type: string
        description: Component type name to set on the story content.
      initialContent:
        type: object
        description: Initial content body for the story (must include a component field).
      revisedContent:
        type: object
        description: Revised content body applied during the update step.
  steps:
  - stepId: createStory
    description: Create the draft story with its initial content.
    operationId: createStory
    parameters:
    - name: space_id
      in: path
      value: $inputs.space_id
    requestBody:
      contentType: application/json
      payload:
        story:
          name: $inputs.storyName
          slug: $inputs.storySlug
          content: $inputs.initialContent
    successCriteria:
    - condition: $statusCode == 201
    outputs:
      storyId: $response.body#/story/id
  - stepId: getStory
    description: Read the story back by its numeric ID to confirm its persisted state.
    operationId: getManagementStory
    parameters:
    - name: space_id
      in: path
      value: $inputs.space_id
    - name: story_id
      in: path
      value: $steps.createStory.outputs.storyId
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      currentName: $response.body#/story/name
      currentSlug: $response.body#/story/slug
  - stepId: updateStory
    description: >-
      Update the story with revised content, preserving its name and slug
      from the read-back step.
    operationId: updateStory
    parameters:
    - name: space_id
      in: path
      value: $inputs.space_id
    - name: story_id
      in: path
      value: $steps.createStory.outputs.storyId
    requestBody:
      contentType: application/json
      payload:
        story:
          name: $steps.getStory.outputs.currentName
          slug: $steps.getStory.outputs.currentSlug
          content: $inputs.revisedContent
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      updatedStoryId: $response.body#/story/id
  - stepId: publishStory
    description: Publish the updated story so it goes live in the Content Delivery API.
    operationId: publishStory
    parameters:
    - name: space_id
      in: path
      value: $inputs.space_id
    - name: story_id
      in: path
      value: $steps.createStory.outputs.storyId
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      publishedStoryId: $response.body#/story/id
      publishedAt: $response.body#/story/published_at
  outputs:
    storyId: $steps.createStory.outputs.storyId
    publishedStoryId: $steps.publishStory.outputs.publishedStoryId
    publishedAt: $steps.publishStory.outputs.publishedAt