PHPackages                             tourze/dify-dsl - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. tourze/dify-dsl

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

tourze/dify-dsl
===============

A framework-agnostic PHP library for parsing and generating Dify DSL (Domain-Specific Language) workflows

1.0.0(6mo ago)00MITPHPPHP ^8.2CI passing

Since Nov 2Pushed 4mo agoCompare

[ Source](https://github.com/tourze/dify-dsl)[ Packagist](https://packagist.org/packages/tourze/dify-dsl)[ Docs](https://github.com/tourze/dify-dsl)[ RSS](/packages/tourze-dify-dsl/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (3)Versions (2)Used By (0)

Dify DSL PHP Library
====================

[](#dify-dsl-php-library)

[English](README.md) | [中文](README.zh-CN.md)

A framework-agnostic PHP library for parsing and generating Dify DSL (Domain-Specific Language) workflows.

[![PHP Version](https://camo.githubusercontent.com/c9f64f714c636ba27a3bba6dfd52f98426832db1262747efa54b212d16943651/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253545382e322d626c7565)](https://packagist.org/packages/tourze/dify-dsl)[![License](https://camo.githubusercontent.com/f8df3091bbe1149f398a5369b2c39e896766f9f6efba3477c63e9b4aa940ef14/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e)](LICENSE)

Features
--------

[](#features)

- **Workflow Builder** - Fluent API for building complex workflows with ease
- **DSL Parser** - Parse existing Dify DSL YAML files into PHP objects
- **Code Generation** - Generate valid Dify DSL YAML from PHP objects
- **Node Types** - Support for all major Dify node types
- **Type Safety** - Full PHP 8.2+ type declarations
- **Validation** - Built-in validation for workflow structure
- **Extensible** - Easy to extend with custom node types

Installation
------------

[](#installation)

```
composer require tourze/dify-dsl
```

Usage
-----

[](#usage)

### 1. Building Workflows with Fluent API

[](#1-building-workflows-with-fluent-api)

```
