Workflow
class Workflow
Workflows are where data analysis happens on Redivis. Workflows are owned by a user or organization, and contain datasources, transforms, notebooks, parameters, and the tables they produce. Various methods allow you to create and delete workflows, to construct and list the entities within a workflow, and to query its tables.
Constructors
redivis.workflow(name[, options])
Return a Workflow, given its qualified reference (e.g., jane.my_workflow), or its name within the default user or organization.
Return the default workflow, if one is set.
Organization.workflow(name)
Return a Workflow owned by an organization.
User.workflow(name)
Return a Workflow owned by a user.
Organization.listWorkflows([maxResults])
List the Workflows owned by an organization.
User.listWorkflows([maxResults])
List the Workflows owned by a user.
Examples
const workflow = redivis.user('jane').workflow('my_workflow');
await workflow.exists(); // -> true
await workflow.get(); // workflow.properties is now populated with the workflow resource definition
workflow.table('output_table'); // -> Returns a Table
workflow.query('SELECT * FROM output_table'); // -> Returns a Query, scoped to the workflow
await workflow.listTables(); // -> Returns an array of Tablesconst workflow = await redivis.workflow('jane.my_workflow').create();
// Add a dataset as a source of the workflow
const datasource = await workflow.datasource('demo.iris_species').create();
// Create and run a transform
const transform = await workflow.transform().create({
sourceTable: 'demo.iris_species.iris',
query: 'SELECT Species, AVG(SepalLengthCm) AS avg_sepal_length FROM _source_ GROUP BY Species',
});
await transform.run();
const rows = await (await transform.outputTable()).toRowsArray();
// Clean up
await transform.delete();
await datasource.delete();
await workflow.delete();Attributes
name
The workflow's name.
organization
A reference to the Organization that owns the workflow. Will be undefined if the workflow is owned by a user.
user
A reference to the User that owns the workflow. Will be undefined if the workflow is owned by an organization.
properties
An object containing the API resource representation of the workflow. This will only be populated after certain methods are called, particularly the get method, and will otherwise be undefined.
qualifiedReference
The fully qualified reference to this workflow, e.g. jane.my_workflow
scopedReference
The canonical reference for the workflow, without its owner.
Methods
Workflow.create([options])
Create the workflow.
Workflow.datasource(source)
Return a Datasource within the workflow.
Delete the workflow.
Check whether the workflow exists.
Fetch the workflow's metadata, populating workflow.properties.
Workflow.listDatasources([maxResults])
List the workflow's Datasources.
Workflow.listNotebooks([maxResults])
List the workflow's Notebooks.
Workflow.listParameters([maxResults])
List the workflow's Parameters.
Workflow.listTables([maxResults, options])
List the workflow's Tables.
Workflow.listTransforms([maxResults])
List the workflow's Transforms.
Workflow.notebook(name)
Return a Notebook within the workflow.
Workflow.parameter(name)
Return a Parameter within the workflow.
Workflow.query(query)
Return a Query scoped to the workflow.
Workflow.table(name)
Return a Table within the workflow.
Workflow.transform([name])
Return a Transform within the workflow.
Workflow.updateVariables(variables)
Batch update variable metadata across the workflow's tables.
Was this helpful?

