// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 // snippet-start:[javascript.v3.entity-resolution.hello] import { fileURLToPath } from "node:url"; import { EntityResolutionClient, ListMatchingWorkflowsCommand, } from "@aws-sdk/client-entityresolution"; export const main = async () => { const region = "eu-west-1"; const erClient = new EntityResolutionClient({ region: region }); try { const command = new ListMatchingWorkflowsCommand({}); const response = await erClient.send(command); const workflowSummaries = response.workflowSummaries; for (const workflowSummary of workflowSummaries) { console.log(`Attribute name: ${workflowSummaries[0].workflowName} `); } if (workflowSummaries.length === 0) { console.log("No matching workflows found."); } } catch (error) { console.error( `An error occurred in listing the workflow summaries: ${error.message} \n Exiting program.`, ); return; } }; // snippet-end:[javascript.v3.entity-resolution.hello] // Invoke main function if this file was run directly. if (process.argv[1] === fileURLToPath(import.meta.url)) { main(); }