bumpy-match-83743
07/10/2024, 5:33 PMancient-wolf-19325
07/10/2024, 5:33 PMjava-flytekit
, you can use the FlyteAdminClient
class from the flytekit-java
library. Hereβs a concise summary of the steps:
1. Define Workflow: Create your workflow and tasks using the SdkWorkflow
and SdkTask
classes.
2. Register Workflow: Use jflyte
to register your workflow.
3. Trigger Execution: Utilize FlyteAdminClient
to trigger the workflow execution.
Here is an example of how you can trigger a workflow execution:
import org.flyte.jflyte.FlyteAdminClient;
import org.flyte.api.v1.LiteralMap;
import org.flyte.api.v1.TaskIdentifier;
import org.flyte.api.v1.WorkflowExecutionIdentifier;
public class WorkflowExecutor {
public static void main(String[] args) {
FlyteAdminClient client = FlyteAdminClient.create();
// Define the task identifier
TaskIdentifier taskIdentifier = TaskIdentifier.builder()
.domain("development")
.project("my_project")
.name("my_task")
.version("v1")
.build();
// Define the input parameters
LiteralMap inputs = LiteralMap.of(...); // Populate with your inputs
// Trigger the workflow execution
WorkflowExecutionIdentifier executionId = client.createExecution(
"development",
"my_project",
"my_launch_plan",
inputs
);
System.out.println("Workflow execution started with ID: " + executionId.name());
}
}
Would you like more detail?
Sources:
- Flytekit-Java
- Flyte Java Workflow Example π 0 button π 0 button π‘ Hint: Mention @runllm in the thread for followups.bumpy-match-83743
07/17/2024, 1:38 PMancient-wolf-19325
07/17/2024, 1:38 PMjflyte
to register your workflow.
3. Trigger Execution: Utilize FlyteAdminClient
to trigger the workflow execution.
Here is an example of how you can trigger a workflow execution in Scala:
import org.flyte.jflyte.FlyteAdminClient
import org.flyte.api.v1.{LiteralMap, TaskIdentifier, WorkflowExecutionIdentifier}
object WorkflowExecutor {
def main(args: Array[String]): Unit = {
val client = FlyteAdminClient.create()
// Define the task identifier
val taskIdentifier = TaskIdentifier.builder()
.domain("development")
.project("my_project")
.name("my_task")
.version("v1")
.build()
// Define the input parameters
val inputs = LiteralMap.of(...) // Populate with your inputs
// Trigger the workflow execution
val executionId = client.createExecution(
"development",
"my_project",
"my_launch_plan",
inputs
)
println(s"Workflow execution started with ID: ${executionId.name()}")
}
}
Would you like more detail?
Sources:
- Flytekit-Java
- Flyte Java Workflow Example π 0 button π 1 button π‘ Hint: Mention @ancient-wolf-19325 in the thread for followups.bumpy-match-83743
07/17/2024, 1:40 PMancient-wolf-19325
07/17/2024, 1:40 PM