CreateFlowDefinitionCommand

Creates a flow definition.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { SageMakerClient, CreateFlowDefinitionCommand } from "@aws-sdk/client-sagemaker"; // ES Modules import
// const { SageMakerClient, CreateFlowDefinitionCommand } = require("@aws-sdk/client-sagemaker"); // CommonJS import
const client = new SageMakerClient(config);
const input = { // CreateFlowDefinitionRequest
  FlowDefinitionName: "STRING_VALUE", // required
  HumanLoopRequestSource: { // HumanLoopRequestSource
    AwsManagedHumanLoopRequestSource: "AWS/Rekognition/DetectModerationLabels/Image/V3" || "AWS/Textract/AnalyzeDocument/Forms/V1", // required
  },
  HumanLoopActivationConfig: { // HumanLoopActivationConfig
    HumanLoopActivationConditionsConfig: { // HumanLoopActivationConditionsConfig
      HumanLoopActivationConditions: "STRING_VALUE", // required
    },
  },
  HumanLoopConfig: { // HumanLoopConfig
    WorkteamArn: "STRING_VALUE", // required
    HumanTaskUiArn: "STRING_VALUE", // required
    TaskTitle: "STRING_VALUE", // required
    TaskDescription: "STRING_VALUE", // required
    TaskCount: Number("int"), // required
    TaskAvailabilityLifetimeInSeconds: Number("int"),
    TaskTimeLimitInSeconds: Number("int"),
    TaskKeywords: [ // FlowDefinitionTaskKeywords
      "STRING_VALUE",
    ],
    PublicWorkforceTaskPrice: { // PublicWorkforceTaskPrice
      AmountInUsd: { // USD
        Dollars: Number("int"),
        Cents: Number("int"),
        TenthFractionsOfACent: Number("int"),
      },
    },
  },
  OutputConfig: { // FlowDefinitionOutputConfig
    S3OutputPath: "STRING_VALUE", // required
    KmsKeyId: "STRING_VALUE",
  },
  RoleArn: "STRING_VALUE", // required
  Tags: [ // TagList
    { // Tag
      Key: "STRING_VALUE", // required
      Value: "STRING_VALUE", // required
    },
  ],
};
const command = new CreateFlowDefinitionCommand(input);
const response = await client.send(command);
// { // CreateFlowDefinitionResponse
//   FlowDefinitionArn: "STRING_VALUE", // required
// };

CreateFlowDefinitionCommand Input

Parameter
Type
Description
FlowDefinitionName
Required
string | undefined

The name of your flow definition.

OutputConfig
Required
FlowDefinitionOutputConfig | undefined

An object containing information about where the human review results will be uploaded.

RoleArn
Required
string | undefined

The Amazon Resource Name (ARN) of the role needed to call other services on your behalf. For example, arn:aws:iam::1234567890:role/service-role/AmazonSageMaker-ExecutionRole-20180111T151298.

HumanLoopActivationConfig
HumanLoopActivationConfig | undefined

An object containing information about the events that trigger a human workflow.

HumanLoopConfig
HumanLoopConfig | undefined

An object containing information about the tasks the human reviewers will perform.

HumanLoopRequestSource
HumanLoopRequestSource | undefined

Container for configuring the source of human task requests. Use to specify if Amazon Rekognition or Amazon Textract is used as an integration source.

Tags
Tag[] | undefined

An array of key-value pairs that contain metadata to help you categorize and organize a flow definition. Each tag consists of a key and a value, both of which you define.

CreateFlowDefinitionCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
FlowDefinitionArn
Required
string | undefined

The Amazon Resource Name (ARN) of the flow definition you create.

Throws

Name
Fault
Details
ResourceInUse
client

Resource being accessed is in use.

ResourceLimitExceeded
client

You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

SageMakerServiceException
Base exception class for all service exceptions from SageMaker service.