Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport 2.x] Updated Workflow Interface #34

Merged
merged 4 commits into from
Sep 13, 2023
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
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();

}
Loading