Salesforce

Create a scheduled job using GraphQL

« Go Back
Information
Create a scheduled job using GraphQL
000004251
Public
Product Selection
aiWare - aiWare
Article Details

To create a scheduled job, use the createScheduledJob input type, being sure to specify a runMode and scheduleParts.

Before you begin

  • To access any aiWARE API, you must firstĀ Get a token.

Scheduled job example without a source

This example creates a scheduled job that runs between 6:00 a.m. Pacific to 8:00 p.m. Pacific, Monday through Friday. The jobs launch on schedule to ingest the contents of the URL (a radio URL for example) in 15 minute segments.

mutation CreateScheduledJob{
      createScheduledJob(
        input: {
          name: "yourScheduledJob"
          startDateTime: "2022-01-20T22:20:00.000Z"
          runMode: Recurring
          weeklyScheduleParts: [
                            {
              scheduledDay: Monday
              startTime: "06:00"
              stopTime:"20:00"
            }
                            {
              scheduledDay: Tuesday
              startTime: "06:00"
              stopTime:"20:00"
            }
                            {
              scheduledDay: Wednesday
              startTime: "06:00"
              stopTime:"20:00"
            }
                            {
              scheduledDay: Thursday
              startTime: "06:00"
              stopTime:"20:00"
            }
                            {
              scheduledDay: Friday
              startTime: "06:00"
              stopTime:"20:00"
            }
          ]
          jobTemplates: {
          jobConfig: {
             maxTDODuration: 15
          }
          clusterId: "yourClusterID"
            taskTemplates: [
              { 
             # Engine to ingest radio stream
                engineId: "74dfd76b-472a-48f0-8395-c7e01dd7f255"
                payload: {
                  url: "yourRadioURL" 
                  isLive: true
                }
                ioFolders: [{ referenceId: "tvrOut", mode: stream, type: output }]
              }
         {
            # Chunk engine to split into audio chunks of 5min each
            engineId: "8bdb0e3b-ff28-4f6e-a3ba-887bd06e6440"  
            payload:{
              ffmpegTemplate: "audio"
              customFFMPEGProperties:{
                chunkSizeInSeconds: "300"
               }
              }
            ioFolders: [
            {
              referenceId: "chunkAudioInputFolder"
              mode: stream
              type: input
            },
            {
              referenceId: "chunkAudioOutputFolder"
              mode: chunk
              type: output
            }
            ],
           executionPreferences: {
                 parentCompleteBeforeStarting: true
            }
          }
          {
            # Transcription Engine 
            engineId:"c0e55cde-340b-44d7-bb42-2e0d65e98255"
            ioFolders: [
              {
                referenceId: "transcriptionInputFolder"
                mode: chunk
                type: input
              },
             {
                referenceId: "transcriptionOutputFolder"
                mode: chunk
                type: output
              }
            ]
          }
          {
                # Output Writer: aggregate transcription output to store in TDO
                engineId: "8eccf9cc-6b6d-4d7d-8cb3-7ebf4950c5f3"
                executionPreferences: { parentCompleteBeforeStarting: true }
                ioFolders: [{ referenceId: "owIn", mode: chunk, type: input }]
              }
            ]
            routes: [
              {
                parentIoFolderReferenceId: "tvrOut"
                childIoFolderReferenceId: "chunkAudioInputFolder"
              }
           {  ## chunkAudio --> Transcription
            parentIoFolderReferenceId: "chunkAudioOutputFolder"
            childIoFolderReferenceId: "transcriptionInputFolder"
            options: {}
          }
              {
                parentIoFolderReferenceId: "transcriptionOutputFolder"
                childIoFolderReferenceId: "owIn"
              }
            ]
          }
        }
      ) {
        id
        }
      }

What to do next

Additional Technical Documentation Information
Properties
1/26/2024 3:53 PM
1/26/2024 4:01 PM
1/26/2024 4:01 PM
Documentation
Documentation
000004251
Translation Information
English

Powered by