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

Method handleAutomationTriggersFire

internal/extension/host_api.go:1764–1791  ·  view source on GitHub ↗
(ctx context.Context, raw json.RawMessage)

Source from the content-addressed store, hash-verified

1762}
1763
1764func (h *HostAPIHandler) handleAutomationTriggersFire(ctx context.Context, raw json.RawMessage) (any, error) {
1765 automation, err := h.automationManager()
1766 if err != nil {
1767 return nil, err
1768 }
1769
1770 var params hostAPIAutomationTriggerFireParams
1771 if err := decodeHostAPIParams(raw, &params); err != nil {
1772 return nil, err
1773 }
1774
1775 workspaceID, err := h.resolveAutomationWorkspaceID(ctx, params.WorkspaceID)
1776 if err != nil {
1777 return nil, err
1778 }
1779
1780 request := automationpkg.ExtensionTriggerRequest{
1781 Event: strings.TrimSpace(params.Event),
1782 Scope: params.Scope,
1783 WorkspaceID: workspaceID,
1784 Payload: cloneJSONMap(params.Payload),
1785 }
1786 if err := request.Validate("trigger_fire"); err != nil {
1787 return nil, invalidParamsRPCError(err)
1788 }
1789
1790 return automation.FireExtensionTrigger(ctx, request)
1791}
1792
1793func (h *HostAPIHandler) handleAutomationRuns(ctx context.Context, raw json.RawMessage) (any, error) {
1794 automation, err := h.automationManager()

Callers

nothing calls this directly

Calls 7

automationManagerMethod · 0.95
ValidateMethod · 0.95
decodeHostAPIParamsFunction · 0.85
invalidParamsRPCErrorFunction · 0.85
cloneJSONMapFunction · 0.70
FireExtensionTriggerMethod · 0.65

Tested by

no test coverage detected