Class WorkflowRun.Builder
- java.lang.Object
-
- ai.extend.types.WorkflowRun.Builder
-
- All Implemented Interfaces:
WorkflowRun._FinalStage,WorkflowRun.IdStage,WorkflowRun.InitialRunAtStage,WorkflowRun.NameStage,WorkflowRun.ObjectStage,WorkflowRun.ReviewedStage,WorkflowRun.StatusStage,WorkflowRun.UrlStage,WorkflowRun.WorkflowStage
- Enclosing class:
- WorkflowRun
public static final class WorkflowRun.Builder extends java.lang.Object implements WorkflowRun.ObjectStage, WorkflowRun.IdStage, WorkflowRun.NameStage, WorkflowRun.UrlStage, WorkflowRun.StatusStage, WorkflowRun.InitialRunAtStage, WorkflowRun.ReviewedStage, WorkflowRun.WorkflowStage, WorkflowRun._FinalStage
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description WorkflowRun._FinalStageaddAllFiles(java.util.List<File> files)WorkflowRun._FinalStageaddAllOutputs(java.util.List<ProcessorRun> outputs)WorkflowRun._FinalStageaddAllStepRuns(java.util.List<StepRun> stepRuns)An array of WorkflowStepRun objects.WorkflowRun._FinalStageaddFiles(File files)WorkflowRun._FinalStageaddOutputs(ProcessorRun outputs)WorkflowRun._FinalStageaddStepRuns(StepRun stepRuns)An array of WorkflowStepRun objects.WorkflowRun._FinalStagebatchId(java.lang.String batchId)The batch ID of the WorkflowRun.WorkflowRun._FinalStagebatchId(java.util.Optional<java.lang.String> batchId)The batch ID of the WorkflowRun.WorkflowRunbuild()WorkflowRun._FinalStageendTime(java.time.OffsetDateTime endTime)The time (in UTC) that the workflow finished executing.WorkflowRun._FinalStageendTime(java.util.Optional<java.time.OffsetDateTime> endTime)The time (in UTC) that the workflow finished executing.WorkflowRun._FinalStagefailureMessage(java.lang.String failureMessage)A more detailed message about the failure.WorkflowRun._FinalStagefailureMessage(java.util.Optional<java.lang.String> failureMessage)A more detailed message about the failure.WorkflowRun._FinalStagefailureReason(java.lang.String failureReason)The reason why the workflow run failed.WorkflowRun._FinalStagefailureReason(java.util.Optional<java.lang.String> failureReason)The reason why the workflow run failed.WorkflowRun._FinalStagefiles(java.util.List<File> files)WorkflowRun.Builderfrom(WorkflowRun other)WorkflowRun.NameStageid(java.lang.String id)The ID of the workflow run.WorkflowRun.ReviewedStageinitialRunAt(java.time.OffsetDateTime initialRunAt)The time (in UTC) at which the workflow run was created.WorkflowRun._FinalStagemetadata(java.lang.String key, java.lang.Object value)The metadata that was passed in when running the Workflow.WorkflowRun._FinalStagemetadata(java.util.Map<java.lang.String,java.lang.Object> metadata)The metadata that was passed in when running the Workflow.WorkflowRun.UrlStagename(java.lang.String name)The name of the workflow run.WorkflowRun.IdStageobject(java.lang.String object)The type of response.WorkflowRun._FinalStageoutputs(java.util.List<ProcessorRun> outputs)WorkflowRun._FinalStageputAllMetadata(java.util.Map<java.lang.String,java.lang.Object> metadata)The metadata that was passed in when running the Workflow.WorkflowRun._FinalStagerejectionNote(java.lang.String rejectionNote)A note that is added if a workflow run is rejected.WorkflowRun._FinalStagerejectionNote(java.util.Optional<java.lang.String> rejectionNote)A note that is added if a workflow run is rejected.WorkflowRun.WorkflowStagereviewed(boolean reviewed)Whether the workflow run has been reviewed.WorkflowRun._FinalStagereviewedAt(java.time.OffsetDateTime reviewedAt)The time (in UTC) at which the workflow run was reviewed.WorkflowRun._FinalStagereviewedAt(java.util.Optional<java.time.OffsetDateTime> reviewedAt)The time (in UTC) at which the workflow run was reviewed.WorkflowRun._FinalStagereviewedBy(java.lang.String reviewedBy)The email address of the person who reviewed the workflow run.WorkflowRun._FinalStagereviewedBy(java.util.Optional<java.lang.String> reviewedBy)The email address of the person who reviewed the workflow run.WorkflowRun._FinalStagestartTime(java.time.OffsetDateTime startTime)The time (in UTC) at which the workflow run started executing.WorkflowRun._FinalStagestartTime(java.util.Optional<java.time.OffsetDateTime> startTime)The time (in UTC) at which the workflow run started executing.WorkflowRun.InitialRunAtStagestatus(WorkflowStatus status)WorkflowRun._FinalStagestepRuns(java.util.List<StepRun> stepRuns)An array of WorkflowStepRun objects.WorkflowRun.StatusStageurl(java.lang.String url)A URL to view this workflow run in the Extend UI.WorkflowRun._FinalStageusage(WorkflowRunCredits usage)WorkflowRun._FinalStageusage(java.util.Optional<WorkflowRunCredits> usage)WorkflowRun._FinalStageworkflow(Workflow workflow)
-
-
-
Method Detail
-
from
public WorkflowRun.Builder from(WorkflowRun other)
- Specified by:
fromin interfaceWorkflowRun.ObjectStage
-
object
public WorkflowRun.IdStage object(@NotNull java.lang.String object)
The type of response. In this case, it will always be
"workflow_run".The type of response. In this case, it will always be
"workflow_run".- Specified by:
objectin interfaceWorkflowRun.ObjectStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
id
public WorkflowRun.NameStage id(@NotNull java.lang.String id)
The ID of the workflow run.
Example:
"workflow_run_xKm9pNv3qWsY_jL2tR5Dh"The ID of the workflow run.
Example:
"workflow_run_xKm9pNv3qWsY_jL2tR5Dh"- Specified by:
idin interfaceWorkflowRun.IdStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
name
public WorkflowRun.UrlStage name(@NotNull java.lang.String name)
The name of the workflow run.
Example:
"myFirstFile.pdf"The name of the workflow run.
Example:
"myFirstFile.pdf"- Specified by:
namein interfaceWorkflowRun.NameStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
url
public WorkflowRun.StatusStage url(@NotNull java.lang.String url)
A URL to view this workflow run in the Extend UI.
Example:
"https://dashboard.extend.ai/workflows/workflow_Bk9mNp2qWs5_xL8vR4tYh?workflowRunId=workflow_run_Zj3nMx7ZPd9f4c2WQ_kAg"A URL to view this workflow run in the Extend UI.
Example:
"https://dashboard.extend.ai/workflows/workflow_Bk9mNp2qWs5_xL8vR4tYh?workflowRunId=workflow_run_Zj3nMx7ZPd9f4c2WQ_kAg"- Specified by:
urlin interfaceWorkflowRun.UrlStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
status
public WorkflowRun.InitialRunAtStage status(@NotNull WorkflowStatus status)
- Specified by:
statusin interfaceWorkflowRun.StatusStage
-
initialRunAt
public WorkflowRun.ReviewedStage initialRunAt(@NotNull java.time.OffsetDateTime initialRunAt)
The time (in UTC) at which the workflow run was created. Will follow the RFC 3339 format.
Example:
"2025-04-28T17:01:39.285Z"The time (in UTC) at which the workflow run was created. Will follow the RFC 3339 format.
Example:
"2025-04-28T17:01:39.285Z"- Specified by:
initialRunAtin interfaceWorkflowRun.InitialRunAtStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
reviewed
public WorkflowRun.WorkflowStage reviewed(boolean reviewed)
Whether the workflow run has been reviewed.
Whether the workflow run has been reviewed.
- Specified by:
reviewedin interfaceWorkflowRun.ReviewedStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
workflow
public WorkflowRun._FinalStage workflow(@NotNull Workflow workflow)
- Specified by:
workflowin interfaceWorkflowRun.WorkflowStage
-
usage
public WorkflowRun._FinalStage usage(WorkflowRunCredits usage)
- Specified by:
usagein interfaceWorkflowRun._FinalStage
-
usage
public WorkflowRun._FinalStage usage(java.util.Optional<WorkflowRunCredits> usage)
- Specified by:
usagein interfaceWorkflowRun._FinalStage
-
addAllStepRuns
public WorkflowRun._FinalStage addAllStepRuns(java.util.List<StepRun> stepRuns)
An array of WorkflowStepRun objects. Each WorkflowStepRun represents a single run of a WorkflowStep and contains details about the step and the run's output.
Note: This field currently supports External Data Validation and Rule Validation step types. Document processor run outputs are included in the outputs field.
- Specified by:
addAllStepRunsin interfaceWorkflowRun._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
addStepRuns
public WorkflowRun._FinalStage addStepRuns(StepRun stepRuns)
An array of WorkflowStepRun objects. Each WorkflowStepRun represents a single run of a WorkflowStep and contains details about the step and the run's output.
Note: This field currently supports External Data Validation and Rule Validation step types. Document processor run outputs are included in the outputs field.
- Specified by:
addStepRunsin interfaceWorkflowRun._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
stepRuns
public WorkflowRun._FinalStage stepRuns(java.util.List<StepRun> stepRuns)
An array of WorkflowStepRun objects. Each WorkflowStepRun represents a single run of a WorkflowStep and contains details about the step and the run's output.
Note: This field currently supports External Data Validation and Rule Validation step types. Document processor run outputs are included in the outputs field.
- Specified by:
stepRunsin interfaceWorkflowRun._FinalStage
-
addAllOutputs
public WorkflowRun._FinalStage addAllOutputs(java.util.List<ProcessorRun> outputs)
- Specified by:
addAllOutputsin interfaceWorkflowRun._FinalStage
-
addOutputs
public WorkflowRun._FinalStage addOutputs(ProcessorRun outputs)
- Specified by:
addOutputsin interfaceWorkflowRun._FinalStage
-
outputs
public WorkflowRun._FinalStage outputs(java.util.List<ProcessorRun> outputs)
- Specified by:
outputsin interfaceWorkflowRun._FinalStage
-
endTime
public WorkflowRun._FinalStage endTime(java.time.OffsetDateTime endTime)
The time (in UTC) that the workflow finished executing. Will follow the RFC 3339 format. Will not be included if the workflow run has not finished executing.
Example:
"2024-03-21T15:35:00Z"- Specified by:
endTimein interfaceWorkflowRun._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
endTime
public WorkflowRun._FinalStage endTime(java.util.Optional<java.time.OffsetDateTime> endTime)
The time (in UTC) that the workflow finished executing. Will follow the RFC 3339 format. Will not be included if the workflow run has not finished executing.
Example:
"2024-03-21T15:35:00Z"- Specified by:
endTimein interfaceWorkflowRun._FinalStage
-
startTime
public WorkflowRun._FinalStage startTime(java.time.OffsetDateTime startTime)
The time (in UTC) at which the workflow run started executing. This will always be after the
initialRunAttime. Will follow the RFC 3339 format. Will not be included if the workflow run has not started executing.Example:
"2024-03-21T15:30:00Z"- Specified by:
startTimein interfaceWorkflowRun._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
startTime
public WorkflowRun._FinalStage startTime(java.util.Optional<java.time.OffsetDateTime> startTime)
The time (in UTC) at which the workflow run started executing. This will always be after the
initialRunAttime. Will follow the RFC 3339 format. Will not be included if the workflow run has not started executing.Example:
"2024-03-21T15:30:00Z"- Specified by:
startTimein interfaceWorkflowRun._FinalStage
-
reviewedAt
public WorkflowRun._FinalStage reviewedAt(java.time.OffsetDateTime reviewedAt)
The time (in UTC) at which the workflow run was reviewed. Will follow the RFC 3339 format. Will not be included if the workflow run has not been reviewed.
Example:
"2024-03-21T16:45:00Z"- Specified by:
reviewedAtin interfaceWorkflowRun._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
reviewedAt
public WorkflowRun._FinalStage reviewedAt(java.util.Optional<java.time.OffsetDateTime> reviewedAt)
The time (in UTC) at which the workflow run was reviewed. Will follow the RFC 3339 format. Will not be included if the workflow run has not been reviewed.
Example:
"2024-03-21T16:45:00Z"- Specified by:
reviewedAtin interfaceWorkflowRun._FinalStage
-
rejectionNote
public WorkflowRun._FinalStage rejectionNote(java.lang.String rejectionNote)
A note that is added if a workflow run is rejected.
Example:
"Invalid invoice format"- Specified by:
rejectionNotein interfaceWorkflowRun._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
rejectionNote
public WorkflowRun._FinalStage rejectionNote(java.util.Optional<java.lang.String> rejectionNote)
A note that is added if a workflow run is rejected.
Example:
"Invalid invoice format"- Specified by:
rejectionNotein interfaceWorkflowRun._FinalStage
-
reviewedBy
public WorkflowRun._FinalStage reviewedBy(java.lang.String reviewedBy)
The email address of the person who reviewed the workflow run. Will not be included if the workflow run has not been reviewed.
Example:
"jane.doe@example.com"- Specified by:
reviewedByin interfaceWorkflowRun._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
reviewedBy
public WorkflowRun._FinalStage reviewedBy(java.util.Optional<java.lang.String> reviewedBy)
The email address of the person who reviewed the workflow run. Will not be included if the workflow run has not been reviewed.
Example:
"jane.doe@example.com"- Specified by:
reviewedByin interfaceWorkflowRun._FinalStage
-
failureMessage
public WorkflowRun._FinalStage failureMessage(java.lang.String failureMessage)
A more detailed message about the failure. Will only be included if the workflow run status is "FAILED".
- Specified by:
failureMessagein interfaceWorkflowRun._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
failureMessage
public WorkflowRun._FinalStage failureMessage(java.util.Optional<java.lang.String> failureMessage)
A more detailed message about the failure. Will only be included if the workflow run status is "FAILED".
- Specified by:
failureMessagein interfaceWorkflowRun._FinalStage
-
failureReason
public WorkflowRun._FinalStage failureReason(java.lang.String failureReason)
The reason why the workflow run failed. Will only be included if the workflow run status is "FAILED".
- Specified by:
failureReasonin interfaceWorkflowRun._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
failureReason
public WorkflowRun._FinalStage failureReason(java.util.Optional<java.lang.String> failureReason)
The reason why the workflow run failed. Will only be included if the workflow run status is "FAILED".
- Specified by:
failureReasonin interfaceWorkflowRun._FinalStage
-
addAllFiles
public WorkflowRun._FinalStage addAllFiles(java.util.List<File> files)
- Specified by:
addAllFilesin interfaceWorkflowRun._FinalStage
-
addFiles
public WorkflowRun._FinalStage addFiles(File files)
- Specified by:
addFilesin interfaceWorkflowRun._FinalStage
-
files
public WorkflowRun._FinalStage files(java.util.List<File> files)
- Specified by:
filesin interfaceWorkflowRun._FinalStage
-
batchId
public WorkflowRun._FinalStage batchId(java.lang.String batchId)
The batch ID of the WorkflowRun. If this WorkflowRun was created as part of a batch of files, all runs in that batch will have the same batch ID.
Example:
"batch_7Ws31-F5"- Specified by:
batchIdin interfaceWorkflowRun._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
batchId
public WorkflowRun._FinalStage batchId(java.util.Optional<java.lang.String> batchId)
The batch ID of the WorkflowRun. If this WorkflowRun was created as part of a batch of files, all runs in that batch will have the same batch ID.
Example:
"batch_7Ws31-F5"- Specified by:
batchIdin interfaceWorkflowRun._FinalStage
-
metadata
public WorkflowRun._FinalStage metadata(java.lang.String key, java.lang.Object value)
The metadata that was passed in when running the Workflow.
- Specified by:
metadatain interfaceWorkflowRun._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
putAllMetadata
public WorkflowRun._FinalStage putAllMetadata(java.util.Map<java.lang.String,java.lang.Object> metadata)
The metadata that was passed in when running the Workflow.
- Specified by:
putAllMetadatain interfaceWorkflowRun._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
metadata
public WorkflowRun._FinalStage metadata(java.util.Map<java.lang.String,java.lang.Object> metadata)
The metadata that was passed in when running the Workflow.
- Specified by:
metadatain interfaceWorkflowRun._FinalStage
-
build
public WorkflowRun build()
- Specified by:
buildin interfaceWorkflowRun._FinalStage
-
-