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

# Create workflow

> Create a new workflow by specifying the description, filter, data source, and data destination

This endpoint creates a new workflow that connects data sources, filters, and destinations for stream processing.

## Supported Values

### data\_source\_config

| Field | Values            |
| :---- | :---------------- |
| type  | `PUBSUB`, `KAFKA` |

### data\_destination\_config

| Field          | Values            |
| :------------- | :---------------- |
| type           | `PUBSUB`, `KAFKA` |
| delivery\_type | `PULL`, `PUSH`    |

## Important Notes

<Note>
  **PubSub Topic Format**

  In PubSub, a full topic resource name is in the format `projects/{project_id}/topics/{topic_name}`.

  However, for `data_source_config`, you **only** need to specify the `{topic_name}` (e.g., `ethereum.transactions`).
</Note>

### Destination Configuration Requirements

When specifying `data_destination_config`:

* **PULL delivery** - Only the `type` field is required
* **PUSH delivery** - Both `type` and `webhook_url` fields are required


## OpenAPI

````yaml /_openapi/data-transformation-api.json POST /api/v1/streams/data-management/workflows
openapi: 3.1.0
info:
  title: Allium API
  version: 0.1.0
servers:
  - url: https://api.allium.so
security: []
paths:
  /api/v1/streams/data-management/workflows:
    post:
      tags:
        - STREAMS
        - DATA-MANAGEMENT
        - WORKFLOWS
      summary: Workflow
      description: >-
        Create a new workflow by specifying the description, filter, data
        source, and data destination
      operationId: >-
        create_data_transformation_workflow_api_v1_streams_data_management_workflows_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DataTransformationWorkflowRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataTransformationWorkflowResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyBearer: []
components:
  schemas:
    DataTransformationWorkflowRequest:
      properties:
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        filter_id:
          type: string
          format: uuid
          title: Filter Id
        data_source_config:
          anyOf:
            - $ref: '#/components/schemas/PubSubDataSourceMetadata'
            - $ref: '#/components/schemas/KafkaDataSourceMetadata'
          title: Data Source Config
        data_destination_config:
          anyOf:
            - $ref: '#/components/schemas/PubSubDataDestinationMetadata'
            - $ref: '#/components/schemas/KafkaDataDestinationMetadata'
          title: Data Destination Config
      type: object
      required:
        - filter_id
        - data_source_config
        - data_destination_config
      title: DataTransformationWorkflowRequest
    DataTransformationWorkflowResponse:
      properties:
        id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Id
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        filter_id:
          type: string
          format: uuid
          title: Filter Id
        data_source_config:
          anyOf:
            - $ref: '#/components/schemas/PubSubDataSourceMetadata'
            - $ref: '#/components/schemas/KafkaDataSourceMetadata'
          title: Data Source Config
        data_destination_config:
          anyOf:
            - $ref: '#/components/schemas/PubSubDataDestinationMetadata'
            - $ref: '#/components/schemas/KafkaDataDestinationMetadata'
          title: Data Destination Config
        external_workflow_id:
          anyOf:
            - type: string
            - type: 'null'
          title: External Workflow Id
      type: object
      required:
        - filter_id
        - data_source_config
        - data_destination_config
      title: DataTransformationWorkflowResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    PubSubDataSourceMetadata:
      properties:
        type:
          type: string
          const: PUBSUB
          title: Type
          default: PUBSUB
        topic:
          type: string
          title: Topic
      type: object
      required:
        - topic
      title: PubSubDataSourceMetadata
    KafkaDataSourceMetadata:
      properties:
        type:
          type: string
          const: KAFKA
          title: Type
          default: KAFKA
        topic:
          type: string
          title: Topic
      type: object
      required:
        - topic
      title: KafkaDataSourceMetadata
    PubSubDataDestinationMetadata:
      properties:
        type:
          type: string
          const: PUBSUB
          title: Type
          default: PUBSUB
        delivery_type:
          type: string
          enum:
            - PUSH
            - PULL
          title: Delivery Type
          default: PULL
        webhook_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Webhook Url
      type: object
      title: PubSubDataDestinationMetadata
    KafkaDataDestinationMetadata:
      properties:
        type:
          type: string
          const: KAFKA
          title: Type
          default: KAFKA
      type: object
      title: KafkaDataDestinationMetadata
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyBearer:
      type: apiKey
      in: header
      name: X-API-KEY

````