Skip to content

Commit

Permalink
add handle
Browse files Browse the repository at this point in the history
  • Loading branch information
lorensr committed Jul 29, 2022
1 parent 082d691 commit ebbbab5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions typescript/schedules.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { myWorkflow } from './workflows'
const client = new ScheduleClient()

const schedule = await client.create({
id: 'biz-id',
id: 'schedule-biz-id',
spec: {
// every hour at minute 5
interval: {
Expand All @@ -41,7 +41,7 @@ const schedule = await client.create({
action: {
startWorkflow: {
// type: WorkflowStartOptions & { workflowId: string }
workflowId: 'biz-id',
workflowId: 'wf-biz-id',
type: myWorkflow,
args: ['sorry this is the only thing reused, chad 😄'],
// ... other WorkflowOptions
Expand Down Expand Up @@ -73,6 +73,8 @@ const schedule = await client.create({
searchAttributes,
})

const schedule = await client.getHandle('schedule-biz-id')

This comment has been minimized.

Copy link
@bergundy

bergundy Jul 29, 2022

Member

Shouldn't be async, doesn't need to do any IO


const scheduleDescription = await schedule.describe()

const matchingStartTimes = await schedule.listMatchingTimes({ start: new Date(), end: new Date() })
Expand Down

0 comments on commit ebbbab5

Please sign in to comment.