Summary

Implement RESTful API endpoints that allow programmatic creation of playground sessions with entity context. This enables external systems, custom modules, and JavaScript applications to create entity-aware workflow sessions without requiring direct PHP access.

Business Value

  • Enables decoupled frontends to launch FlowDrop workflows for specific entities
  • Supports integration with external content management systems and workflows
  • Allows building custom UI components that trigger entity-specific workflows
  • Provides programmatic access for batch processing and automation scripts

Features Implemented

  • Create Session Endpoint: POST endpoint to create sessions with entity context
  • Get Entity Context Endpoint: GET endpoint to retrieve entity context from existing sessions
  • JSON Request/Response: Standard JSON format for all API interactions
  • Comprehensive Error Handling: Proper HTTP status codes and error messages

Technical Implementation

  • NodeSessionApiController handling all REST endpoints
  • Route: POST /api/flowdrop-node-session/workflows/{workflow_id}/sessions
  • Route: GET /api/flowdrop-node-session/sessions/{session_id}/entity-context
  • Custom access callbacks for fine-grained permission control
  • Request body parsing with validation for required parameters

API Usage Example

POST /api/flowdrop-node-session/workflows/my_workflow/sessions
Content-Type: application/json

{
  "entity_type": "node",
  "entity_id": "123",
  "revision_id": "456",
  "bundle": "article",
  "name": "Review Article #123",
  "metadata": {}
}

Comments

joevagyok created an issue. See original summary.

d34dman’s picture

Version: » 1.x-dev
Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.