Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions core/activity-contracts/activity/activity.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package activity

import "context"

// GlobalActivityOutputs maps each action name to a list of its result maps.
// {"noop.log": [{"logged": "hello"}, {"logged": "world"}], "noop.echo": [...]}
type GlobalActivityOutputs map[string][]map[string]interface{}

// ActivityInput is the generic input passed to all activities.
type ActivityInput struct {
Action string `json:"action"`
Params map[string]interface{} `json:"params"`
StepName string `json:"step_name"`
WorkflowExecutionId string `json:"workflow_execution_id"`
Async bool `json:"async"`
PluginVersion string `json:"plugin_version"`
StepId string `json:"step_id,omitempty"`
}

// ActivityOutput is the generic output returned by all activities.
type ActivityOutput struct {
Result map[string]interface{} `json:"result,omitempty"`
Error string `json:"error,omitempty"`
}

// ActivityFunc is the function signature that every registered activity must implement.
type ActivityFunc func(ctx context.Context, globalOutputs GlobalActivityOutputs, input ActivityInput) (ActivityOutput, error)
3 changes: 3 additions & 0 deletions core/activity-contracts/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module github.com/Meesho/BharatMLStack/core/activity-contracts

go 1.25.6
Loading