feat: expose executor job observability
This commit is contained in:
@@ -105,7 +105,7 @@ export function createRemoteWorkflowEngine({
|
||||
id: normalizedId,
|
||||
label,
|
||||
kind: 'remote',
|
||||
capabilities: ['durable-execution', 'interrupt', 'streaming'],
|
||||
capabilities: ['durable-execution', 'interrupt', 'streaming', 'executor-observability'],
|
||||
async start(spec) {
|
||||
return request('/v1/runs', { method: 'POST', body: JSON.stringify(spec) });
|
||||
},
|
||||
@@ -129,5 +129,15 @@ export function createRemoteWorkflowEngine({
|
||||
const result = await request(`/v1/runs/${encodeURIComponent(runId)}/events${query}`);
|
||||
for (const event of Array.isArray(result?.events) ? result.events : []) yield event;
|
||||
},
|
||||
async getExecutorJob(jobId) {
|
||||
return request(`/v1/executor-jobs/${encodeURIComponent(jobId)}`);
|
||||
},
|
||||
async *streamExecutorJobEvents(jobId, cursor = null) {
|
||||
const query = cursor == null ? '' : `?after=${encodeURIComponent(cursor)}`;
|
||||
const result = await request(
|
||||
`/v1/executor-jobs/${encodeURIComponent(jobId)}/events${query}`,
|
||||
);
|
||||
for (const event of Array.isArray(result?.events) ? result.events : []) yield event;
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user