definitions/proto/workflow.proto

60 lines
1.1 KiB
Protocol Buffer

syntax = "proto3";
package proto;
option go_package = "git.servflow.io/servflow/definitions/proto";
service WorkflowService {
rpc GetAllWorkflowConfigs(GetAllWorkflowConfigsRequest) returns (WorkflowConfigs) {}
rpc GetAllDatabases(GetAllDatabasesRequest) returns (GetAllDatabasesResponse) {}
}
message GetAllDatabasesRequest{}
message GetAllDatabasesResponse{
repeated DatabaseConfig databases = 1;
}
message GetAllWorkflowConfigsRequest {}
message WorkflowConfigs {
repeated WorkflowConfig configs = 1;
}
message WorkflowConfig {
string id = 1;
string listen_path = 2;
string method = 3;
Request request = 4;
map<string, Action> actions = 5;
map<string, Conditional> conditionals = 6;
map<string, Response> responses = 7;
}
message Request {
string next = 1;
}
message Action {
string type = 1;
string config = 2;
string next = 3;
}
message Conditional {
string expression = 1;
string valid_path = 2;
string invalid_path = 3;
}
message Response {
string template = 1;
string type = 2;
int32 code = 3;
}
message DatabaseConfig {
string id = 1;
string config = 2;
string type = 3;
}