We use the Apify JS client and started seeing some strange errors when programmatically creating new actor tasks. Here is the code we use to create a task
const task = await apifyClient.tasks().create({
actId: "apify/website-content-crawler",
options: { memoryMbytes: 4096, build: "version-0" },
input: { ...BASE_TASK_INPUT, startUrls: [{ url }], maxCrawlDepth: depth },
});
As you can see we don't provide an argument for
title
or
name
and instead rely on the autogenerated value from Apify, e.g.
website-content-crawler-task-2
website-content-crawler-task-3
...
However, the error in the screenshot suggests that there is a name conflict. I suspect that this is happening because we are creating many tasks concurrently and the Apify server's internal counter collides when creating the new task.
- Can someone confirm if this is the case?
- Is it suggested that we provide own name to avoid issues like this in the future?
- What is the valid format for a task name in Apify? (e.g. character limit, valid character set, etc.)
- How about task titles? Do they have any name restrictions?
Thank you!