MCPcopy Create free account
hub / github.com/compozy/agh / enqueueTaskRunFromRequest

Function enqueueTaskRunFromRequest

internal/api/core/tasks.go:2243–2258  ·  view source on GitHub ↗
(taskID string, req contract.EnqueueTaskRunRequest)

Source from the content-addressed store, hash-verified

2241}
2242
2243func enqueueTaskRunFromRequest(taskID string, req contract.EnqueueTaskRunRequest) (taskpkg.EnqueueRun, error) {
2244 if err := validateTaskChannel("enqueue_run.network_channel", req.NetworkChannel); err != nil {
2245 return taskpkg.EnqueueRun{}, err
2246 }
2247
2248 spec := taskpkg.EnqueueRun{
2249 TaskID: strings.TrimSpace(taskID),
2250 IdempotencyKey: strings.TrimSpace(req.IdempotencyKey),
2251 NetworkChannel: strings.TrimSpace(req.NetworkChannel),
2252 Metadata: append(json.RawMessage(nil), req.Metadata...),
2253 }
2254 if err := spec.Validate("enqueue_run"); err != nil {
2255 return taskpkg.EnqueueRun{}, err
2256 }
2257 return spec, nil
2258}
2259
2260type fanOutDesignationMetadataPayload struct {
2261 Designation fanOutDesignationMetadataDetail `json:"designation"`

Callers 2

EnqueueTaskRunMethod · 0.70

Calls 3

ValidateMethod · 0.95
appendFunction · 0.85
validateTaskChannelFunction · 0.70

Tested by 1