> ## Documentation Index
> Fetch the complete documentation index at: https://developers.hubspot.jp/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a workflow

> Create a new workflow with the supplied JSON body.

export const ScopesList = ({scopes = [], description = "この API には、次のいずれかのスコープが必要です。"}) => {
  if (!scopes || scopes.length === 0) {
    return null;
  }
  const sortedScopes = scopes.sort((a, b) => a.localeCompare(b));
  return <div>
      <div className="text-sm mb-2">{description}</div>
      <div>
        {sortedScopes.map((scope, index) => <div key={index}>
            <code>
              <span className="text-xs">{scope}</span>
            </code>
          </div>)}
      </div>
    </div>;
};

<Accordion title="Scope requirements">
  <ScopesList scopes={['automation']} />
</Accordion>


## OpenAPI

````yaml specs/legacy/v3/create-manage-workflows-v3.json POST /automation/v3/workflows
openapi: 3.0.0
info:
  title: Workflows API v3
  version: 1.0.0
  description: >-
    Workflows API v3 - Auto-generated from MDX documentation. Use the Workflows
    API to create and manage workflows, enroll or remove contacts, and retrieve
    performance data.
servers:
  - url: https://api.hubapi.com
    description: HubSpot API Server
security: []
paths:
  /automation/v3/workflows:
    post:
      summary: Create a workflow
      description: Create a new workflow with the supplied JSON body.
      operationId: createWorkflow
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WorkflowCreateRequest'
            examples:
              drip_delay_workflow:
                summary: Drip delay workflow with webhook
                description: >-
                  Creates a workflow with a delay, property update, and webhook
                  action
                value:
                  name: Test Workflow
                  type: DRIP_DELAY
                  onlyEnrollsManually: true
                  actions:
                    - type: DELAY
                      delayMillis: 3600000
                    - newValue: HubSpot
                      propertyName: company
                      type: SET_CONTACT_PROPERTY
                    - type: WEBHOOK
                      url: https://www.myintegration.com/webhook.php
                      method: POST
                      authCreds:
                        user: user
                        password: password
              static_anchor_workflow:
                summary: Date-based workflow with static anchor
                description: >-
                  Creates a workflow that executes on a specific date for all
                  enrolled contacts
                value:
                  name: Test Workflow
                  type: STATIC_ANCHOR
                  onlyEnrollsManually: true
                  eventAnchor:
                    staticDateAnchor: 10/09/2014
                  actions:
                    - type: DELAY
                      delayMillis: 0
                      anchorSetting:
                        boundary: 'ON'
                        execTimeOfDay: 12:00 PM
                    - type: SET_CONTACT_PROPERTY
                      propertyName: company
                      newValue: HubSpot
              auto_enrollment_workflow:
                summary: Workflow with automatic enrollment criteria
                description: >-
                  Creates a workflow that automatically enrolls contacts based
                  on lifecycle stage
                value:
                  name: Test Workflow
                  type: DRIP_DELAY
                  segmentCriteria:
                    - - operator: SET_ANY
                        value: lead;salesqualifiedlead;marketingqualifiedlead
                        property: lifecyclestage
                        type: string
                  actions:
                    - type: SET_CONTACT_PROPERTY
                      propertyName: company
                      newValue: HubSpot
              branching_workflow:
                summary: Workflow with branching logic
                description: >-
                  Creates a workflow with conditional branches based on contact
                  industry
                value:
                  name: Test Workflow
                  type: DRIP_DELAY
                  onlyEnrollsManually: true
                  actions:
                    - type: BRANCH
                      filters:
                        - - operator: EQ
                            value: Marketing Software
                            property: industry
                            type: string
                      acceptActions:
                        - type: SET_CONTACT_PROPERTY
                          propertyName: hubspot_owner_id
                          newValue: '12345'
                      rejectActions:
                        - type: SET_CONTACT_PROPERTY
                          propertyName: hubspot_owner_id
                          newValue: '67890'
      responses:
        '201':
          description: Workflow created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Workflow'
        default:
          $ref: '#/components/responses/Error'
components:
  schemas:
    WorkflowCreateRequest:
      type: object
      description: Body for creating a workflow
      properties:
        name:
          type: string
        type:
          type: string
        actions:
          type: array
          items:
            type: object
      required:
        - name
    Workflow:
      type: object
      description: Simplified workflow schema
      properties:
        id:
          type: integer
        name:
          type: string
        type:
          type: string
        enabled:
          type: boolean
    Error:
      type: object
      properties:
        status:
          type: string
        message:
          type: string
        correlationId:
          type: string
  responses:
    Error:
      description: Error response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'

````