@php $input = $run->input ?? []; $prospect = $input['prospect'] ?? $input['entity'] ?? []; $tasks = $run->tasks->sortBy('id'); // The send outcome lives on whichever task executed the send. $sendTask = $tasks->first(fn ($t) => ! empty(data_get($t->output_payload, 'mailblaze_message_id')) || ! empty(data_get($t->output_payload, 'send_failed')) || ! empty(data_get($t->output_payload, 'send_skipped'))); @endphp
← All runs

Run #{{ $run->id }}

{{ $run->trigger }} · {{ $run->started_at?->format('Y-m-d H:i') }} @if ($run->finished_at) · finished {{ $run->finished_at->diffForHumans() }} @endif · ${{ number_format((float) $run->total_cost_usd, 4) }} · {{ number_format((int) $run->total_tokens) }} tokens

{{-- Who this run was about --}} @if (! empty($prospect))

Prospect

{{ $prospect['name'] ?? $prospect['email'] ?? 'Unknown' }}

{{ $prospect['title'] ?? '' }} @if (! empty($prospect['company'])) · {{ $prospect['company'] }} @endif @if (! empty($prospect['country'])) · {{ $prospect['country'] }} @endif

@if (! empty($prospect['email'])) {{ $prospect['email'] }} @endif @if (! empty($prospect['industry'])) · {{ $prospect['industry'] }} @endif

@endif {{-- Outcome: approval + send --}}

Outcome

Approval @if ($approval) @if ($approval->reviewed_at) {{ $approval->reviewed_at->diffForHumans() }} @endif open → @else — not reached @endif
Send @php $sp = $sendTask?->output_payload ?? []; @endphp @if (! empty($sp['mailblaze_message_id'])) id {{ $sp['mailblaze_message_id'] }} @elseif (! empty($sp['send_failed'])) {{ $sp['send_failed'] }} @elseif (! empty($sp['send_skipped'])) {{ $sp['send_skipped'] }} @else — not sent @endif
{{-- The full pipeline cycle, stage by stage --}}

Pipeline cycle

@if ($tasks->isEmpty()) @else
    @foreach ($tasks as $i => $task) @php $skill = $task->skills_applied[0] ?? '—'; $p = $task->output_payload ?? []; $score = data_get($p, 'score'); @endphp
  1. {{ $i + 1 }}
    @if (! $loop->last)
    @endif
    {{ $skill }} {{ $task->type }} @if (($task->tokens_used ?? 0) > 0) {{ number_format((int) $task->tokens_used) }} tok · ${{ number_format((float) $task->cost_usd, 4) }} @endif
    @if ($task->skip_reason)
    ⤷ {{ $task->skip_reason }}
    @endif @if ($score !== null)
    Score {{ $score }}/10 @if (data_get($p, 'reason')) — {{ data_get($p, 'reason') }} @endif
    @endif @if (data_get($p, 'subject'))
    Subject: {{ data_get($p, 'subject') }}
    @endif @if (data_get($p, 'text') && in_array($task->type, ['draft'], true))
    {{ \Illuminate\Support\Str::limit(data_get($p, 'text'), 600) }}
    @endif @if (str_starts_with((string) $skill, 'pipedrive') && data_get($p, 'text'))
    {{ data_get($p, 'text') }}
    @endif
  2. @endforeach
@endif