Workflow Args
data class WorkflowArgs(val description: Output<String>? = null, val labels: Output<Map<String, String>>? = null, val name: Output<String>? = null, val namePrefix: Output<String>? = null, val project: Output<String>? = null, val region: Output<String>? = null, val serviceAccount: Output<String>? = null, val sourceContents: Output<String>? = null) : ConvertibleToJava<WorkflowArgs>
Workflow program to be executed by Workflows. To get more information about Workflow, see:
How-to Guides
Example Usage
Workflow Basic
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.serviceAccount.Account;
import com.pulumi.gcp.serviceAccount.AccountArgs;
import com.pulumi.gcp.workflows.Workflow;
import com.pulumi.gcp.workflows.WorkflowArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var testAccount = new Account("testAccount", AccountArgs.builder()
.accountId("my-account")
.displayName("Test Service Account")
.build());
var example = new Workflow("example", WorkflowArgs.builder()
.region("us-central1")
.description("Magic")
.serviceAccount(testAccount.id())
.sourceContents("""
# This is a sample workflow, feel free to replace it with your source code
#
# This workflow does the following:
# - reads current time and date information from an external API and stores
# the response in CurrentDateTime variable
# - retrieves a list of Wikipedia articles related to the day of the week
# from CurrentDateTime
# - returns the list of articles as an output of the workflow
# FYI, In terraform you need to escape the $$ or it will cause errors.
- getCurrentTime:
call: http.get
args:
url: https://us-central1-workflowsample.cloudfunctions.net/datetime
result: CurrentDateTime
- readWikipedia:
call: http.get
args:
url: https://en.wikipedia.org/w/api.php
query:
action: opensearch
search: %s
result: WikiResult
- returnOutput:
return: %s
", CurrentDateTime.body().dayOfTheWeek(),WikiResult.body()[1]))
.build());
}
}
Content copied to clipboard
Import
This resource does not support import.
Constructors
Link copied to clipboard
fun WorkflowArgs(description: Output<String>? = null, labels: Output<Map<String, String>>? = null, name: Output<String>? = null, namePrefix: Output<String>? = null, project: Output<String>? = null, region: Output<String>? = null, serviceAccount: Output<String>? = null, sourceContents: Output<String>? = null)