{"id":31756736,"url":"https://github.com/ebay/orchestra","last_synced_at":"2025-10-09T19:22:54.604Z","repository":{"id":242931821,"uuid":"804010378","full_name":"eBay/orchestra","owner":"eBay","description":null,"archived":false,"fork":false,"pushed_at":"2025-10-02T00:33:21.000Z","size":118,"stargazers_count":2,"open_issues_count":16,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-10-02T02:40:00.124Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eBay.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":"SUPPORT.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-05-21T19:30:47.000Z","updated_at":"2024-10-10T07:20:32.000Z","dependencies_parsed_at":"2024-06-05T20:13:49.091Z","dependency_job_id":"e1b392bc-99f7-4eb5-8fab-d53fb60027b6","html_url":"https://github.com/eBay/orchestra","commit_stats":null,"previous_names":["ebay/orchestra"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/eBay/orchestra","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eBay%2Forchestra","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eBay%2Forchestra/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eBay%2Forchestra/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eBay%2Forchestra/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eBay","download_url":"https://codeload.github.com/eBay/orchestra/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eBay%2Forchestra/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279001978,"owners_count":26083243,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-10-09T19:22:52.783Z","updated_at":"2025-10-09T19:22:54.598Z","avatar_url":"https://github.com/eBay.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Workflow Orchestrator \n\nWorkflow Orchestrator provides a functionality to define and run workflows in intended ways. Workflow is a collection of one or more tasks and a task contains the user defined code. Execution of the tasks is configurable and can be done in sequential, parallel, repetitive and conditional ways.\n\n# Key Concepts\nBelow are the basic key concepts which a developer should get aware of before integrating with the workflow library. \n## Task\nTask is the basic working entity in this platform. Concrete implementation of Task class is required to perform any operation such as making a service call or doing a request/response conversion. \n\n## Task Report\nEvery task must return a report. The report essentially has a success/failure information and can also contain other details such as an error during the execution of the task. \n\n## Workflow\nWorkflow is a collection of one or more tasks. Execution of the tasks is configurable and can be done in sequential, parallel, repetitive and conditional ways. Keep in mind that all workflow types can accept both tasks as well as another workflow as its input(s). All workflows need to have the below fields set in the YAML file.\n\n    \u003cUnique Workflow ID:\u003e:\n      desc: \u003cA short description\u003e\n      type: \u003crepeat/conditional/parallel/sequential\u003e\n\n## Executable\nBoth workflows and tasks are commonly referred to as `executable` in the YAML file.\n\n## Workflow Types\n\n### Repeat Workflow\nRepeat Workflow is used to execute a task or workflow repeatedly until the condition is met. While configuring a repeat workflow in the YAML file, the developer needs to mention the following fields.\n\n\n    repeatWF:\n      executable: \u003cTask which needs to be executed\u003e\n      times: \u003cint\u003e\n\n\n### Parallel Workflow\nParallel Workflow should be used to perform multiple tasks or workflows in parallel. Parallel Flow submits the tasks listed in the flow to the java executor service whose timeout can be configured in the YAML file. Below is the syntax for writing a parallel workflow in the YAML file. \n\n    parallelWF:\n      timeout: \u003clong\u003e\n      executables:\n        \u003cTask 1 which needs to be executed in parallel\u003e:\n          instanceGenerator: \u003coptional field - If multiple instances of the above task needs to be run in parallel\u003e\n          elementType: \u003coptional field - Constructor argument such as String, Long, etc\u003e\n        \u003cTask 2 which needs to be executed in parallel\u003e:\n        ...\n        \u003cTask n which needs to be executed in parallel\u003e:\n        \u003cWorkflow 1 which needs to be executed in parallel\u003e:\n        \u003cWorkflow 2 which needs to be executed in parallel\u003e:\n        ...\n        \u003cWorkflow n which needs to be executed in parallel\u003e:\n\n### Conditional Workflow\nConditional Workflow helps in branching the execution path. For instance, if request validation passes, then perform other steps otherwise construct error message and exit out. Below is the syntax for writing a conditional workflow in the YAML file. \n\n    conditionalWF:\n      executable: \u003ctask or workflow\u003e\n      thenExecutable: \u003ctask or workflow\u003e\n      otherwiseExecutable: \u003ctask or workflow\u003e\n\n### Sequential Workflow\nAs the name suggests, Sequential workflow is used to execute tasks or workflows in the order they are listed. Below is the syntax for writing a sequential workflow in the YAML file. \n\n    sequentialWF:\n      executable: [\u003ctask 1\u003e, \u003ctask 2\u003e, \u003cworkflow 1\u003e, ... \u003ctask n\u003e]\n\n### Sample Workflow\n\n![image](https://github.com/eBay/orchestra/assets/78416587/221c0391-719f-4745-b77a-87da0e697b44)\n\n\n## Getting Started\n\n```\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.ebay.riskmgmt\u003c/groupId\u003e\n  \u003cartifactId\u003eorchestra\u003c/artifactId\u003e\n  \u003cversion\u003eUse Latest Release version\u003c/version\u003e\n\u003c/dependency\u003e\n```\n### Define workflow structure through yaml\n\n```\nname: Sample Workflow\nversion: 1.0\n\n# List down the task beans here\ntask:\n  taskA:\n  taskB:\n  taskC:\n  taskD:\n\n\n# List down the workflows\nworkflow:\n  SequentialWF:\n    desc: main sequential workflow\n    type: sequential\n    sequentialWF:\n      executables: [taskC, taskD]\n      \n  ConditionalWF:\n    desc: Validate and proceed conditional workflow\n    type: conditional\n    conditionalWF:\n      executable: taskB\n      thenExecutable: taskD\n      otherwiseExecutable: SequentialWF\n  \n  StarterWF:\n    desc: main sequential workflow\n    type: sequential\n    sequentialWF:\n      executables: [taskA, ConditionalWF]\n\n# Main workflow where execution begins\nengine: StarterWF\n\n```\n\n### Write tasks\n```\npublic class TaskA implements Task {\n    @Override\n    public String getName() {\n        return this.getClass().getSimpleName();\n    }\n\n    @Override\n    public TaskReport execute(WorkflowContext workflowContext) throws WorkflowException {\n        System.out.println(\"Executing \" + getName());\n        return new DefaultTaskReport(TaskStatus.COMPLETED);\n    }\n}\n```\n\n### Define task beans\n\n```\n@Configuration\n@Import(CoreAppConfig.class)\npublic class ServiceAppConfig {\n\n    @Bean(name = \"taskA\")\n    public TaskA getTaskA() {\n        return new TaskA();\n    }\n\n    @Bean(name = \"taskB\")\n    public TaskB getTaskB() {\n        return new TaskB();\n    }\n\n    @Bean(name = \"taskC\")\n    public TaskC getTaskC() {\n        return new TaskC();\n    }\n\n    @Bean(name = \"taskD\")\n    public TaskD getTaskD() {\n        return new TaskD();\n    }\n}\n```\n\n### Run workflow\n\n```\npublic void foo() {\n    WorkflowManager workflowManager = applicationContext.getBean(WorkflowManager.class);\n    WorkflowContext workflowContext = new WorkflowContext();\n    workflowContext.setContextFilePath(\"path/to/workflow/dir\");\n    workflowContext.setContextFile(\"sampleWorkflow.yaml\");\n    try {\n      workflowManager.execute(workflowContext);\n    } catch (WorkflowException e) {\n      throw new RuntimeException(e);\n    }\n  }\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Febay%2Forchestra","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Febay%2Forchestra","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Febay%2Forchestra/lists"}