<?php

declare(strict_types=1);

namespace Drupal\flowdrop_workflow_executor\DTO;

/**
 * Handle returned by {@see \Drupal\flowdrop_workflow_executor\Service\WorkflowLauncherInterface::launch()}.
 *
 * Public API — part of the launcher's BC surface.
 *
 * Deliberately does NOT include workflow outputs. "Launch" creates and
 * dispatches a run; reading what the run produced is a separate operation
 * gated by a separate permission (`view own/any flowdrop_pipeline`).
 * Callers fetch outputs via `GET /api/flowdrop/pipeline/{pipelineId}`
 * once the pipeline reaches a terminal state.
 *
 * - pipelineId — the new pipeline entity's id. Use it with the pipeline
 *                read endpoints to observe progress, status, and outputs.
 * - status     — the pipeline status at the moment launch() returned
 *                (typically 'running'). Use the status endpoint to follow
 *                changes; do not assume this value reflects current state.
 * - queued     — true when the chosen orchestrator hands work to a queue
 *                worker (durable, survives the launching process). False
 *                when the orchestrator runs in the same PHP process after
 *                response flush (fast, non-durable).
 */
final class LaunchResult {

  public function __construct(
    public readonly string $pipelineId,
    public readonly string $status,
    public readonly bool $queued,
  ) {}

}
