Orchesty PHP SDK

The Orchesty PHP SDK provides a robust Symfony-based framework for developing custom integrations, applications, and connectors within the Orchesty platform. It leverages Symfony's dependency injection, event system, and service container to simplify interaction with the orchestration layer and external services.

Purpose #

  • Framework for Integrations: Offers a structured way to build connectors and applications using Symfony components.
  • Communication Layer: Facilitates seamless data exchange between your service and the Orchesty orchestration layer.
  • Extensibility: Design custom nodes, applications, and connectors that can be reused across various workflows.
  • Symfony Integration: Built on top of Symfony framework with full DI container support and modern PHP practices.

Getting Started #

To begin developing with the PHP SDK, ensure you have a basic understanding of Orchesty's architecture and integration concepts.

If you're using the Orchesty-skeleton, the SDK is already set up. For standalone projects, install it via Composer:

composer require orchesty/php-sdk

Key Features #

  • Type-Safe Development: Built with strict typing and modern PHP 8+ features for better code quality.
  • HTTP Client Integration: Simplified API calls with CurlManager and RequestDto.
  • Form Generation: Define user-friendly configuration forms with FormStack and Field components.
  • OAuth2 & OAuth1 Support: Streamlined implementation of OAuth authorization flows.
  • Process Data Handling: Robust ProcessDto for managing data flow and control.
  • Symfony DI Container: Full integration with Symfony's service container for dependency injection.
  • MongoDB Persistence: Built-in support for MongoDB document storage with ApplicationInstall.

SDK Components #

Explore the core components of the PHP SDK:

Core Classes #

Application & Authorization #

Forms & Fields #

  • Form: Defines a single configuration form within an application.
  • FormStack: Manages a collection of forms for complex application configurations.
  • Field: Represents an individual input field within a form.

Data Transfer Objects (DTOs) #

  • ProcessDto: The primary data object flowing through integration processes.
  • BatchProcessDto: Specialized DTO for batch processing operations.

PHP-Specific Patterns #

Symfony Service Registration #

All connectors, applications, and nodes must be registered in Symfony's service container:

# config/services.yaml
services:
    _instanceof:
        Hanaboso\PipesPhpSdk\Connector\ConnectorAbstract:
            tags: ['hbpf.connector']
        Hanaboso\PipesPhpSdk\Application\Base\ApplicationInterface:
            tags: ['hbpf.application']
            
    YourApp\Connector\:
        resource: '../src/Connector'
        autowire: true
        
    YourApp\Application\:
        resource: '../src/Application'
        autowire: true

Dependency Injection #

The SDK fully leverages Symfony's DI container:

<?php declare(strict_types=1);

namespace YourApp\Connector;

use Hanaboso\PipesPhpSdk\Application\Repository\ApplicationInstallRepository;
use Hanaboso\PipesPhpSdk\Connector\ConnectorAbstract;

final class MyConnector extends ConnectorAbstract
{
    // Dependencies are automatically injected via constructor
    public function __construct(
        ApplicationInstallRepository $repository
    ) {
        parent::__construct($repository);
    }
}

Traits for Functionality #

The SDK uses traits to provide shared functionality:

// ConnectorTrait - HTTP client management
$response = $this->getSender()->send($request);
$this->evaluateStatusCode($response->getStatusCode(), $dto);

// CommonNodeTrait - Application access
$applicationInstall = $this->getApplicationInstallFromProcess($dto);
$settings = $applicationInstall->getSettings();

Comparison with Node.js SDK #

FeaturePHP SDKNode.js SDK
NamingBasicApplicationAbstractABasicApplication
DISymfony ContainerDIContainer class
TypesPHP 8+ types, strict modeTypeScript interfaces
AsyncSynchronousAsync/await support
PersistenceMongoDB via DocumentAbstractMongoDB via managers
HTTPCurlManagerCurlSender

Next Steps #

See Also #

© 2025 Orchesty Solutions. All rights reserved.