Skip to content

Commit

Permalink
[Backport 2.x] Updated Workflow Interface (opensearch-project#34)
Browse files Browse the repository at this point in the history
Updated Workflow Interface (opensearch-project#30)

* Updated Workflow Interface



* Updated method definition to handle input/output



---------


(cherry picked from commit 0f0b65d)

Signed-off-by: Owais Kazi <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Owais Kazi <[email protected]>
  • Loading branch information
3 people authored Sep 13, 2023
1 parent db3316b commit 58db87b
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*/
package org.opensearch.flowframework.workflow;

/**
* Interface for handling the input/output of the building blocks.
*/
public interface WorkflowData {}
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,26 @@
*/
package org.opensearch.flowframework.workflow;

import org.opensearch.common.Nullable;

import java.util.concurrent.CompletableFuture;

/**
* Interface for the workflow setup of different building blocks.
*/
public interface Workflow {
public interface WorkflowStep {

/**
* Triggers the processing of the building block.
*
* @param data for input/output params of the building blocks.
* @return CompletableFuture of the building block.
* @throws Exception if execution fails
*/
CompletableFuture<Workflow> execute() throws Exception;
CompletableFuture<WorkflowData> execute(@Nullable WorkflowData data);

/**
*
* @return the name of this workflow step.
*/
String getName();

}

0 comments on commit 58db87b

Please sign in to comment.